NFSD: Save location of NFSv4 COMPOUND status
[ Upstream commit 3b0ebb255fdc49a3d340846deebf045ef58ec744 ] Refactor: Currently nfs4svc_encode_compoundres() relies on the NFS dispatcher to pass in the buffer location of the COMPOUND status. Instead, save that buffer location in struct nfsd4_compoundres. The compound tag follows immediately after. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
f747ce574c
commit
47047d40af
@@ -2456,11 +2456,11 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
|
|||||||
__be32 status;
|
__be32 status;
|
||||||
|
|
||||||
resp->xdr = &rqstp->rq_res_stream;
|
resp->xdr = &rqstp->rq_res_stream;
|
||||||
|
resp->statusp = resp->xdr->p;
|
||||||
|
|
||||||
/* reserve space for: NFS status code */
|
/* reserve space for: NFS status code */
|
||||||
xdr_reserve_space(resp->xdr, XDR_UNIT);
|
xdr_reserve_space(resp->xdr, XDR_UNIT);
|
||||||
|
|
||||||
resp->tagp = resp->xdr->p;
|
|
||||||
/* reserve space for: taglen, tag, and opcnt */
|
/* reserve space for: taglen, tag, and opcnt */
|
||||||
xdr_reserve_space(resp->xdr, XDR_UNIT * 2 + args->taglen);
|
xdr_reserve_space(resp->xdr, XDR_UNIT * 2 + args->taglen);
|
||||||
resp->taglen = args->taglen;
|
resp->taglen = args->taglen;
|
||||||
|
@@ -5446,11 +5446,16 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p)
|
|||||||
WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
|
WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
|
||||||
buf->tail[0].iov_len);
|
buf->tail[0].iov_len);
|
||||||
|
|
||||||
*p = resp->cstate.status;
|
/*
|
||||||
|
* Send buffer space for the following items is reserved
|
||||||
|
* at the top of nfsd4_proc_compound().
|
||||||
|
*/
|
||||||
|
p = resp->statusp;
|
||||||
|
|
||||||
|
*p++ = resp->cstate.status;
|
||||||
|
|
||||||
rqstp->rq_next_page = resp->xdr->page_ptr + 1;
|
rqstp->rq_next_page = resp->xdr->page_ptr + 1;
|
||||||
|
|
||||||
p = resp->tagp;
|
|
||||||
*p++ = htonl(resp->taglen);
|
*p++ = htonl(resp->taglen);
|
||||||
memcpy(p, resp->tag, resp->taglen);
|
memcpy(p, resp->tag, resp->taglen);
|
||||||
p += XDR_QUADLEN(resp->taglen);
|
p += XDR_QUADLEN(resp->taglen);
|
||||||
|
@@ -702,10 +702,11 @@ struct nfsd4_compoundres {
|
|||||||
struct xdr_stream *xdr;
|
struct xdr_stream *xdr;
|
||||||
struct svc_rqst * rqstp;
|
struct svc_rqst * rqstp;
|
||||||
|
|
||||||
|
__be32 *statusp;
|
||||||
u32 taglen;
|
u32 taglen;
|
||||||
char * tag;
|
char * tag;
|
||||||
u32 opcnt;
|
u32 opcnt;
|
||||||
__be32 * tagp; /* tag, opcount encode location */
|
|
||||||
struct nfsd4_compound_state cstate;
|
struct nfsd4_compound_state cstate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user