mbox series

[v1,00/52] Modernize nfsd4_encode_fattr()

Message ID 169504501081.133720.4162400017732492854.stgit@manet.1015granger.net (mailing list archive)
Headers show
Series Modernize nfsd4_encode_fattr() | expand

Message

Chuck Lever Sept. 18, 2023, 1:56 p.m. UTC
This series restructures the server's fattr4 encoder. It is largely
a maintenance improvement (ie, only 2nd-order benefits). There are
no new features or performance benefits, and I hope there will be no
changes in behavior.

The goals:
* Better alignment with spec
* Easier to read and audit
* Less brittle
* Some code de-duplication

This series applies to v6.6-rc2. Minor adjustment will be needed to
apply it to nfsd-next. I apologize for the number of patches, but
each of them (with only a couple of exceptions) is small and
mechanical, and therefore easily digested.

A branch containing these patches is available in this repo:

  https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git

See the "nfsd4-encoder-overhaul" branch.

---

Chuck Lever (52):
      NFSD: Add simple u32, u64, and bool encoders
      NFSD: Rename nfsd4_encode_bitmap()
      NFSD: Clean up nfsd4_encode_setattr()
      NFSD: Add struct nfsd4_fattr_args
      NFSD: Add nfsd4_encode_fattr4__true()
      NFSD: Add nfsd4_encode_fattr4__false()
      NFSD: Add nfsd4_encode_fattr4_supported_attrs()
      NFSD: Add nfsd4_encode_fattr4_type()
      NFSD: Add nfsd4_encode_fattr4_fh_expire_type()
      NFSD: Add nfsd4_encode_fattr4_change()
      NFSD: Add nfsd4_encode_fattr4_size()
      NFSD: Add nfsd4_encode_fattr4_fsid()
      NFSD: Add nfsd4_encode_fattr4_lease_time()
      NFSD: Add nfsd4_encode_fattr4_rdattr_error()
      NFSD: Add nfsd4_encode_fattr4_aclsupport()
      NFSD: Add nfsd4_encode_nfsace4()
      NFSD: Add nfsd4_encode_fattr4_acl()
      NFSD: Add nfsd4_encode_fattr4_filehandle()
      NFSD: Add nfsd4_encode_fattr4_fileid()
      NFSD: Add nfsd4_encode_fattr4_files_avail()
      NFSD: Add nfsd4_encode_fattr4_files_free()
      NFSD: Add nfsd4_encode_fattr4_files_total()
      NFSD: Add nfsd4_encode_fattr4_fs_locations()
      NFSD: Add nfsd4_encode_fattr4_maxfilesize()
      NFSD: Add nfsd4_encode_fattr4_maxlink()
      NFSD: Add nfsd4_encode_fattr4_maxname()
      NFSD: Add nfsd4_encode_fattr4_maxread()
      NFSD: Add nfsd4_encode_fattr4_maxwrite()
      NFSD: Add nfsd4_encode_fattr4_mode()
      NFSD: Add nfsd4_encode_fattr4_numlinks()
      NFSD: Add nfsd4_encode_fattr4_owner()
      NFSD: Add nfsd4_encode_fattr4_owner_group()
      NFSD: Add nfsd4_encode_fattr4_rawdev()
      NFSD: Add nfsd4_encode_fattr4_space_avail()
      NFSD: Add nfsd4_encode_fattr4_space_free()
      NFSD: Add nfsd4_encode_fattr4_space_total()
      NFSD: Add nfsd4_encode_fattr4_space_used()
      NFSD: Add nfsd4_encode_fattr4_time_access()
      NFSD: Add nfsd4_encode_fattr4_time_create()
      NFSD: Add nfsd4_encode_fattr4_time_delta()
      NFSD: Add nfsd4_encode_fattr4_time_metadata()
      NFSD: Add nfsd4_encode_fattr4_time_modify()
      NFSD: Add nfsd4_encode_fattr4_mounted_on_fileid()
      NFSD: Add nfsd4_encode_fattr4_fs_layout_types()
      NFSD: Add nfsd4_encode_fattr4_layout_types()
      NFSD: Add nfsd4_encode_fattr4_layout_blksize()
      NFSD: Add nfsd4_encode_fattr4_suppattr_exclcreat()
      NFSD: Add nfsd4_encode_fattr4_sec_label()
      NFSD: Add nfsd4_encode_fattr4_xattr_support()
      NFSD: Copy FATTR4 bit number definitions from RFCs
      NFSD: Use a bitmask loop to encode FATTR4 results
      NFSD: Rename nfsd4_encode_fattr()


 fs/nfsd/nfs4xdr.c        | 1419 +++++++++++++++++++++-----------------
 fs/nfsd/nfsfh.c          |    2 +-
 fs/nfsd/nfsfh.h          |    3 +-
 fs/nfsd/xdr4.h           |  119 ++++
 include/linux/iversion.h |    2 +-
 include/linux/nfs4.h     |  260 +++++--
 6 files changed, 1085 insertions(+), 720 deletions(-)

--
Chuck Lever

Comments

Jeff Layton Sept. 22, 2023, 7:20 p.m. UTC | #1
On Mon, 2023-09-18 at 09:56 -0400, Chuck Lever wrote:
> This series restructures the server's fattr4 encoder. It is largely
> a maintenance improvement (ie, only 2nd-order benefits). There are
> no new features or performance benefits, and I hope there will be no
> changes in behavior.
> 
> The goals:
> * Better alignment with spec
> * Easier to read and audit
> * Less brittle
> * Some code de-duplication
> 
> This series applies to v6.6-rc2. Minor adjustment will be needed to
> apply it to nfsd-next. I apologize for the number of patches, but
> each of them (with only a couple of exceptions) is small and
> mechanical, and therefore easily digested.
> 
> A branch containing these patches is available in this repo:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
> 
> See the "nfsd4-encoder-overhaul" branch.
> 
> ---
> 
> Chuck Lever (52):
>       NFSD: Add simple u32, u64, and bool encoders
>       NFSD: Rename nfsd4_encode_bitmap()
>       NFSD: Clean up nfsd4_encode_setattr()
>       NFSD: Add struct nfsd4_fattr_args
>       NFSD: Add nfsd4_encode_fattr4__true()
>       NFSD: Add nfsd4_encode_fattr4__false()
>       NFSD: Add nfsd4_encode_fattr4_supported_attrs()
>       NFSD: Add nfsd4_encode_fattr4_type()
>       NFSD: Add nfsd4_encode_fattr4_fh_expire_type()
>       NFSD: Add nfsd4_encode_fattr4_change()
>       NFSD: Add nfsd4_encode_fattr4_size()
>       NFSD: Add nfsd4_encode_fattr4_fsid()
>       NFSD: Add nfsd4_encode_fattr4_lease_time()
>       NFSD: Add nfsd4_encode_fattr4_rdattr_error()
>       NFSD: Add nfsd4_encode_fattr4_aclsupport()
>       NFSD: Add nfsd4_encode_nfsace4()
>       NFSD: Add nfsd4_encode_fattr4_acl()
>       NFSD: Add nfsd4_encode_fattr4_filehandle()
>       NFSD: Add nfsd4_encode_fattr4_fileid()
>       NFSD: Add nfsd4_encode_fattr4_files_avail()
>       NFSD: Add nfsd4_encode_fattr4_files_free()
>       NFSD: Add nfsd4_encode_fattr4_files_total()
>       NFSD: Add nfsd4_encode_fattr4_fs_locations()
>       NFSD: Add nfsd4_encode_fattr4_maxfilesize()
>       NFSD: Add nfsd4_encode_fattr4_maxlink()
>       NFSD: Add nfsd4_encode_fattr4_maxname()
>       NFSD: Add nfsd4_encode_fattr4_maxread()
>       NFSD: Add nfsd4_encode_fattr4_maxwrite()
>       NFSD: Add nfsd4_encode_fattr4_mode()
>       NFSD: Add nfsd4_encode_fattr4_numlinks()
>       NFSD: Add nfsd4_encode_fattr4_owner()
>       NFSD: Add nfsd4_encode_fattr4_owner_group()
>       NFSD: Add nfsd4_encode_fattr4_rawdev()
>       NFSD: Add nfsd4_encode_fattr4_space_avail()
>       NFSD: Add nfsd4_encode_fattr4_space_free()
>       NFSD: Add nfsd4_encode_fattr4_space_total()
>       NFSD: Add nfsd4_encode_fattr4_space_used()
>       NFSD: Add nfsd4_encode_fattr4_time_access()
>       NFSD: Add nfsd4_encode_fattr4_time_create()
>       NFSD: Add nfsd4_encode_fattr4_time_delta()
>       NFSD: Add nfsd4_encode_fattr4_time_metadata()
>       NFSD: Add nfsd4_encode_fattr4_time_modify()
>       NFSD: Add nfsd4_encode_fattr4_mounted_on_fileid()
>       NFSD: Add nfsd4_encode_fattr4_fs_layout_types()
>       NFSD: Add nfsd4_encode_fattr4_layout_types()
>       NFSD: Add nfsd4_encode_fattr4_layout_blksize()
>       NFSD: Add nfsd4_encode_fattr4_suppattr_exclcreat()
>       NFSD: Add nfsd4_encode_fattr4_sec_label()
>       NFSD: Add nfsd4_encode_fattr4_xattr_support()
>       NFSD: Copy FATTR4 bit number definitions from RFCs
>       NFSD: Use a bitmask loop to encode FATTR4 results
>       NFSD: Rename nfsd4_encode_fattr()
> 
> 
>  fs/nfsd/nfs4xdr.c        | 1419 +++++++++++++++++++++-----------------
>  fs/nfsd/nfsfh.c          |    2 +-
>  fs/nfsd/nfsfh.h          |    3 +-
>  fs/nfsd/xdr4.h           |  119 ++++
>  include/linux/iversion.h |    2 +-
>  include/linux/nfs4.h     |  260 +++++--
>  6 files changed, 1085 insertions(+), 720 deletions(-)
> 
> --
> Chuck Lever
> 

Large set, but the change is fairly mechanical overall, and the result
is much more readable.

Reviewed-by: Jeff Layton <jlayton@kernel.org>