NFSD: Add simple u32, u64, and bool encoders
authorChuck Lever <chuck.lever@oracle.com>
Mon, 18 Sep 2023 13:56:54 +0000 (09:56 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:11 +0000 (12:44 -0400)
commit6cc58291408bea96787d06ca3f5074fdfb3152ca
tree3c8305bc98078822a5b526736008845004856c72
parent789ce196a31dd13276076762204bee87df893e53
NFSD: Add simple u32, u64, and bool encoders

The generic XDR encoders return a length or a negative errno. NFSv4
encoders want to know simply whether the encode ran out of stream
buffer space. The return values for server-side encoding are either
nfs_ok or nfserr_resource.

So far I've found it adds a lot of duplicate code to try to use the
generic XDR encoder utilities when encoding the simple data types in
the NFSv4 operation encoders.

Add a set of NFSv4-specific utilities that handle the basic XDR data
types. These are added in xdr4.h so they might eventually be used by
the callback server and pNFS driver encoders too.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/xdr4.h