Skip to content

Commit d38e570

Browse files
committed
NFSD: Clean up nfsd4_encode_access()
Convert nfsd4_encode_access() to use modern XDR utility functions. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 25c307a commit d38e570

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3908,14 +3908,14 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr,
39083908
{
39093909
struct nfsd4_access *access = &u->access;
39103910
struct xdr_stream *xdr = resp->xdr;
3911-
__be32 *p;
3911+
__be32 status;
39123912

3913-
p = xdr_reserve_space(xdr, 8);
3914-
if (!p)
3915-
return nfserr_resource;
3916-
*p++ = cpu_to_be32(access->ac_supported);
3917-
*p++ = cpu_to_be32(access->ac_resp_access);
3918-
return 0;
3913+
/* supported */
3914+
status = nfsd4_encode_uint32_t(xdr, access->ac_supported);
3915+
if (status != nfs_ok)
3916+
return status;
3917+
/* access */
3918+
return nfsd4_encode_uint32_t(xdr, access->ac_resp_access);
39193919
}
39203920

39213921
static __be32 nfsd4_encode_bind_conn_to_session(struct nfsd4_compoundres *resp, __be32 nfserr,

0 commit comments

Comments
 (0)