summaryrefslogtreecommitdiff
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2023-10-09 21:29:43 +0300
committerChuck Lever <chuck.lever@oracle.com>2023-10-16 19:44:35 +0300
commitd38e570f1915f45708f72129055ea2fb6ad686b3 (patch)
tree0917c1209abdabe3d4f0ad527e156215dbab15b2 /fs/nfsd/nfs4xdr.c
parent25c307acc8203fc8b20bcb3f5029b149ce754bbf (diff)
downloadlinux-d38e570f1915f45708f72129055ea2fb6ad686b3.tar.xz
NFSD: Clean up nfsd4_encode_access()
Convert nfsd4_encode_access() to use modern XDR utility functions. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index a3f04969c3be..5f56f8c02b51 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3908,14 +3908,14 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr,
{
struct nfsd4_access *access = &u->access;
struct xdr_stream *xdr = resp->xdr;
- __be32 *p;
+ __be32 status;
- p = xdr_reserve_space(xdr, 8);
- if (!p)
- return nfserr_resource;
- *p++ = cpu_to_be32(access->ac_supported);
- *p++ = cpu_to_be32(access->ac_resp_access);
- return 0;
+ /* supported */
+ status = nfsd4_encode_uint32_t(xdr, access->ac_supported);
+ if (status != nfs_ok)
+ return status;
+ /* access */
+ return nfsd4_encode_uint32_t(xdr, access->ac_resp_access);
}
static __be32 nfsd4_encode_bind_conn_to_session(struct nfsd4_compoundres *resp, __be32 nfserr,