summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4proc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields2014-01-15 22:26:42 +0100
committerJ. Bruce Fields2014-05-23 15:03:46 +0200
commit2d124dfaad08733077d2c46755716b2873af65a3 (patch)
treeea470c71fddc410efa6133a5d4d84ca82b7557bb /fs/nfsd/nfs4proc.c
parentnfsd4: tweak nfsd4_encode_getattr to take xdr_stream (diff)
downloadkernel-qcow2-linux-2d124dfaad08733077d2c46755716b2873af65a3.tar.gz
kernel-qcow2-linux-2d124dfaad08733077d2c46755716b2873af65a3.tar.xz
kernel-qcow2-linux-2d124dfaad08733077d2c46755716b2873af65a3.zip
nfsd4: move proc_compound xdr encode init to helper
Mechanical transformation with no change of behavior. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r--fs/nfsd/nfs4proc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 94ef528bb1dd..f809aa8d9213 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1253,6 +1253,18 @@ static bool need_wrongsec_check(struct svc_rqst *rqstp)
return !(nextd->op_flags & OP_HANDLES_WRONGSEC);
}
+static void svcxdr_init_encode(struct svc_rqst *rqstp,
+ struct nfsd4_compoundres *resp)
+{
+ struct xdr_stream *xdr = &resp->xdr;
+ struct xdr_buf *buf = &rqstp->rq_res;
+ struct kvec *head = buf->head;
+
+ xdr->buf = buf;
+ xdr->p = head->iov_base + head->iov_len;
+ xdr->end = head->iov_base + PAGE_SIZE;
+}
+
/*
* COMPOUND call.
*/
@@ -1270,13 +1282,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
u32 plen = 0;
__be32 status;
- resp->xdr.buf = &rqstp->rq_res;
- resp->xdr.p = rqstp->rq_res.head[0].iov_base +
- rqstp->rq_res.head[0].iov_len;
+ svcxdr_init_encode(rqstp, resp);
resp->tagp = resp->xdr.p;
/* reserve space for: taglen, tag, and opcnt */
resp->xdr.p += 2 + XDR_QUADLEN(args->taglen);
- resp->xdr.end = rqstp->rq_res.head[0].iov_base + PAGE_SIZE;
resp->taglen = args->taglen;
resp->tag = args->tag;
resp->opcnt = 0;