summaryrefslogtreecommitdiff
path: root/fs/nfsd/nfs2acl.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2020-11-18 14:52:09 -0500
committerChuck Lever <chuck.lever@oracle.com>2021-03-22 10:19:01 -0400
commit07f5c2963c04b11603e9667f89bb430c132e9cc1 (patch)
tree117b503da94c945c374c01d76bdb43be6ebc0b51 /fs/nfsd/nfs2acl.c
parent8d2009a10b3abaa12a39deb4876b215714993fe8 (diff)
NFSD: Update the NFSv2 ACL ACCESS result encoder to use struct xdr_stream
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs2acl.c')
-rw-r--r--fs/nfsd/nfs2acl.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 9270530a0c2f..4b43929c1f25 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -282,16 +282,21 @@ static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
/* ACCESS */
static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
{
+ struct xdr_stream *xdr = &rqstp->rq_res_stream;
struct nfsd3_accessres *resp = rqstp->rq_resp;
- *p++ = resp->status;
- if (resp->status != nfs_ok)
- goto out;
+ if (!svcxdr_encode_stat(xdr, resp->status))
+ return 0;
+ switch (resp->status) {
+ case nfs_ok:
+ if (!svcxdr_encode_fattr(rqstp, xdr, &resp->fh, &resp->stat))
+ return 0;
+ if (xdr_stream_encode_u32(xdr, resp->access) < 0)
+ return 0;
+ break;
+ }
- p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
- *p++ = htonl(resp->access);
-out:
- return xdr_ressize_check(rqstp, p);
+ return 1;
}
/*