Commit 841fd0a3 authored by Chuck Lever's avatar Chuck Lever

NFSD: Finish converting the NFSv3 GETACL result encoder

For some reason, the NFSv2 GETACL result encoder was fully converted
to use the new nfs_stream_encode_acl(), but the NFSv3 equivalent was
not similarly converted.

Fixes: 20798dfe ("NFSD: Update the NFSv3 GETACL result encoder to use struct xdr_stream")
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ea5021e9
...@@ -171,11 +171,7 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr) ...@@ -171,11 +171,7 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{ {
struct nfsd3_getaclres *resp = rqstp->rq_resp; struct nfsd3_getaclres *resp = rqstp->rq_resp;
struct dentry *dentry = resp->fh.fh_dentry; struct dentry *dentry = resp->fh.fh_dentry;
struct kvec *head = rqstp->rq_res.head;
struct inode *inode; struct inode *inode;
unsigned int base;
int n;
int w;
if (!svcxdr_encode_nfsstat3(xdr, resp->status)) if (!svcxdr_encode_nfsstat3(xdr, resp->status))
return false; return false;
...@@ -187,26 +183,12 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr) ...@@ -187,26 +183,12 @@ nfs3svc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
if (xdr_stream_encode_u32(xdr, resp->mask) < 0) if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
return false; return false;
base = (char *)xdr->p - (char *)head->iov_base; if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
resp->mask & NFS_ACL, 0))
rqstp->rq_res.page_len = w = nfsacl_size(
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
while (w > 0) {
if (!*(rqstp->rq_next_page++))
return false; return false;
w -= PAGE_SIZE; if (!nfs_stream_encode_acl(xdr, inode, resp->acl_default,
}
n = nfsacl_encode(&rqstp->rq_res, base, inode,
resp->acl_access,
resp->mask & NFS_ACL, 0);
if (n > 0)
n = nfsacl_encode(&rqstp->rq_res, base + n, inode,
resp->acl_default,
resp->mask & NFS_DFACL, resp->mask & NFS_DFACL,
NFS_ACL_DEFAULT); NFS_ACL_DEFAULT))
if (n <= 0)
return false; return false;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment