nfsd4: no need for encode_compoundres to adjust lengths
xdr_reserve_space should now be calculating the length correctly as we go, so there's no longer any need to fix it up here. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
f46d382a74
commit
dd97fddedc
@ -1618,6 +1618,7 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
|
|||||||
struct nfsd4_sequence *seq)
|
struct nfsd4_sequence *seq)
|
||||||
{
|
{
|
||||||
struct nfsd4_slot *slot = resp->cstate.slot;
|
struct nfsd4_slot *slot = resp->cstate.slot;
|
||||||
|
struct kvec *head = resp->xdr.iov;
|
||||||
__be32 status;
|
__be32 status;
|
||||||
|
|
||||||
dprintk("--> %s slot %p\n", __func__, slot);
|
dprintk("--> %s slot %p\n", __func__, slot);
|
||||||
@ -1631,6 +1632,8 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
|
|||||||
|
|
||||||
resp->opcnt = slot->sl_opcnt;
|
resp->opcnt = slot->sl_opcnt;
|
||||||
resp->xdr.p = resp->cstate.datap + XDR_QUADLEN(slot->sl_datalen);
|
resp->xdr.p = resp->cstate.datap + XDR_QUADLEN(slot->sl_datalen);
|
||||||
|
head->iov_len = (void *)resp->xdr.p - head->iov_base;
|
||||||
|
resp->xdr.buf->len = head->iov_len;
|
||||||
status = slot->sl_status;
|
status = slot->sl_status;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -3789,19 +3789,13 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo
|
|||||||
* All that remains is to write the tag and operation count...
|
* All that remains is to write the tag and operation count...
|
||||||
*/
|
*/
|
||||||
struct nfsd4_compound_state *cs = &resp->cstate;
|
struct nfsd4_compound_state *cs = &resp->cstate;
|
||||||
struct kvec *iov;
|
|
||||||
p = resp->tagp;
|
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);
|
||||||
*p++ = htonl(resp->opcnt);
|
*p++ = htonl(resp->opcnt);
|
||||||
|
|
||||||
if (rqstp->rq_res.page_len)
|
|
||||||
iov = &rqstp->rq_res.tail[0];
|
|
||||||
else
|
|
||||||
iov = &rqstp->rq_res.head[0];
|
|
||||||
iov->iov_len = ((char *)resp->xdr.p) - (char *)iov->iov_base;
|
|
||||||
BUG_ON(iov->iov_len > PAGE_SIZE);
|
|
||||||
if (nfsd4_has_session(cs)) {
|
if (nfsd4_has_session(cs)) {
|
||||||
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
|
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
|
||||||
struct nfs4_client *clp = cs->session->se_client;
|
struct nfs4_client *clp = cs->session->se_client;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user