NFSD: Add nfsd4_encode_fattr4_type()
authorChuck Lever <chuck.lever@oracle.com>
Mon, 18 Sep 2023 13:57:39 +0000 (09:57 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:13 +0000 (12:44 -0400)
commitb06cf3754523682ff92fbc0f7702c32a024a4819
treedf90e28867ef63cd5c550b0aa89623c5dedddcd1
parentc9090e273300cd30dff05ce870a4c18f476a2f32
NFSD: Add nfsd4_encode_fattr4_type()

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>
fs/nfsd/nfs4xdr.c