summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* NFSD: Use a bitmask loop to encode FATTR4 resultsChuck Lever2023-10-161-287/+146
| | | | | | | | | | | | | | | | | The fattr4 encoder is now structured like the COMPOUND op encoder: one function for each individual attribute, called by bit number. Benefits include: - The individual attributes are now guaranteed to be encoded in bitmask order into the send buffer - There can be no unwanted side effects between attribute encoders - The code now clearly documents which attributes are /not/ implemented on this server Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Copy FATTR4 bit number definitions from RFCsChuck Lever2023-10-161-68/+192
| | | | | | | | | | | | | I'd like to convert nfsd4_encode_fattr() to rotate through the attrmask using for_each_bit() instead of explicitly testing the bitmask for each bit value. This means I need the bit numbers, as defined in the specs, instead of our internal bitmask constants. As a clean up, use the new spec-derived values to define the WORD# bitmask constants. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_xattr_support()Chuck Lever2023-10-161-7/+12
| | | | | | | | Refactor the encoder for FATTR4_XATTR_SUPPORT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_sec_label()Chuck Lever2023-10-161-9/+18
| | | | | | | | Refactor the encoder for FATTR4_SEC_LABEL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_suppattr_exclcreat()Chuck Lever2023-10-161-8/+15
| | | | | | | | Refactor the encoder for FATTR4_SUPPATTR_EXCLCREAT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_layout_blksize()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_LAYOUT_BLKSIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_layout_types()Chuck Lever2023-10-161-20/+19
| | | | | | | | Refactor the encoder for FATTR4_LAYOUT_TYPES into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_fs_layout_types()Chuck Lever2023-10-161-1/+23
| | | | | | | | Refactor the encoder for FATTR4_FS_LAYOUT_TYPES into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_mounted_on_fileid()Chuck Lever2023-10-161-17/+22
| | | | | | | | Refactor the encoder for FATTR4_MOUNTED_ON_FILEID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_time_modify()Chuck Lever2023-10-161-1/+7
| | | | | | | | Refactor the encoder for FATTR4_TIME_MODIFY into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_time_metadata()Chuck Lever2023-10-161-1/+7
| | | | | | | | Refactor the encoder for FATTR4_TIME_METADATA into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_time_delta()Chuck Lever2023-10-161-29/+24
| | | | | | | | | | | Refactor the encoder for FATTR4_TIME_DELTA into a helper. In a subsequent patch, this helper will be called from a bitmask loop. fattr4_time_delta is specified as an nfstime4, so de-duplicate this encoder. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_time_create()Chuck Lever2023-10-161-1/+7
| | | | | | | | Refactor the encoder for FATTR4_TIME_CREATE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_time_access()Chuck Lever2023-10-161-4/+10
| | | | | | | | Refactor the encoder for FATTR4_TIME_ACCESS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_space_used()Chuck Lever2023-10-161-6/+9
| | | | | | | | Refactor the encoder for FATTR4_SPACE_USED into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_space_total()Chuck Lever2023-10-161-5/+11
| | | | | | | | Refactor the encoder for FATTR4_SPACE_TOTAL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_space_free()Chuck Lever2023-10-161-5/+11
| | | | | | | | Refactor the encoder for FATTR4_SPACE_FREE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_space_avail()Chuck Lever2023-10-161-5/+11
| | | | | | | | Refactor the encoder for FATTR4_SPACE_AVAIL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_rawdev()Chuck Lever2023-10-161-5/+21
| | | | | | | | Refactor the encoder for FATTR4_RAWDEV into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_owner_group()Chuck Lever2023-10-161-2/+8
| | | | | | | | Refactor the encoder for FATTR4_OWNER_GROUP into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_owner()Chuck Lever2023-10-161-2/+8
| | | | | | | | Refactor the encoder for FATTR4_OWNER into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_numlinks()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_NUMLINKS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_mode()Chuck Lever2023-10-162-4/+10
| | | | | | | | Refactor the encoder for FATTR4_MODE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_maxwrite()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_MAXWRITE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_maxread()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_MAXREAD into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_maxname()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_MAXNAME into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_maxlink()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_MAXLINK into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_maxfilesize()Chuck Lever2023-10-161-4/+11
| | | | | | | | Refactor the encoder for FATTR4_MAXFILESIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_fs_locations()Chuck Lever2023-10-161-38/+28
| | | | | | | | Refactor the encoder for FATTR4_FS_LOCATIONS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_files_total()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_FILES_TOTAL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_files_free()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_FILES_FREE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_files_avail()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_FILES_AVAIL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_fileid()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_FILEID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_filehandle()Chuck Lever2023-10-161-15/+18
| | | | | | | | | | | Refactor the encoder for FATTR4_FILEHANDLE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. We can de-duplicate the other filehandle encoder (in GETFH) using our new helper. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_acl()Chuck Lever2023-10-161-21/+26
| | | | | | | | Refactor the encoder for FATTR4_ACL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_nfsace4()Chuck Lever2023-10-162-15/+24
| | | | | | | | Refactor the ACE encoding helper so that it can eventually be reused for encoding OPEN results that contain delegation ACEs. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_aclsupport()Chuck Lever2023-10-161-5/+14
| | | | | | | | Refactor the encoder for FATTR4_ACLSUPPORT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_rdattr_error()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_RDATTR_ERROR into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_lease_time()Chuck Lever2023-10-162-5/+13
| | | | | | | | Refactor the encoder for FATTR4_LEASE_TIME into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_fsid()Chuck Lever2023-10-161-22/+36
| | | | | | | | Refactor the encoder for FATTR4_FSID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_size()Chuck Lever2023-10-161-4/+9
| | | | | | | | Refactor the encoder for FATTR4_SIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_change()Chuck Lever2023-10-165-26/+39
| | | | | | | | | | | | Refactor the encoder for FATTR4_CHANGE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. The code is restructured a bit to use the modern xdr_stream flow, and the encoded cinfo value is made const so that callers of the encoders can be passed a const cinfo. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_fh_expire_type()Chuck Lever2023-10-161-8/+16
| | | | | | | | Refactor the encoder for FATTR4_FH_EXPIRE_TYPE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_type()Chuck Lever2023-10-161-23/+40
| | | | | | | | | | | | | Refactor the encoder for FATTR4_TYPE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. In addition, restructure the code so that byte-swapping is done on constant values rather than at run time. Run-time swapping can be costly on some platforms, and "type" is a frequently-requested attribute. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4_supported_attrs()Chuck Lever2023-10-161-24/+24
| | | | | | | | Refactor the encoder for FATTR4_SUPPORTED_ATTRS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4__false()Chuck Lever2023-10-161-12/+15
| | | | | | | | | | | Add an encoding helper that encodes a single boolean "false" value. Attributes that always return "false" can use this helper. In a subsequent patch, this helper will be called from a bitmask loop, so it is given a standardized synopsis. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add nfsd4_encode_fattr4__true()Chuck Lever2023-10-161-28/+27
| | | | | | | | | | | Add an encoding helper that encodes a single boolean "true" value. Attributes that always return "true" can use this helper. In a subsequent patch, this helper will be called from a bitmask loop, so it is given a standardized synopsis. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Add struct nfsd4_fattr_argsChuck Lever2023-10-161-52/+65
| | | | | | | | | | I'm about to split nfsd4_encode_fattr() into a number of smaller functions. Instead of passing a large number of arguments to each of the smaller functions, create a struct that can gather the common argument variables into something with a convenient handle on it. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Clean up nfsd4_encode_setattr()Chuck Lever2023-10-161-21/+12
| | | | | | | | De-duplicate the encoding of bitmap4 results in nfsd4_encode_setattr(). Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* NFSD: Rename nfsd4_encode_bitmap()Chuck Lever2023-10-161-13/+15
| | | | | | | | | | | For alignment with the specification, the name of NFSD's encoder function should match the name of the XDR type. I've also replaced a few "naked integers" with symbolic constants that better reflect the usage of these values. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>