diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-02-26 17:16:27 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-05-28 14:52:37 -0400 |
commit | dd97fddedc251eb423408d89f2947eff9c4ea3c1 (patch) | |
tree | 7062237b8685ee9b7cc586748b213c7edf6ce3cc | |
parent | f46d382a749874e1b29cfb34d4ccf283eae4fffa (diff) |
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>
-rw-r--r-- | fs/nfsd/nfs4state.c | 3 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 14bfb5568715..b06f9a00ff8d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1618,6 +1618,7 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, | |||
1618 | struct nfsd4_sequence *seq) | 1618 | struct nfsd4_sequence *seq) |
1619 | { | 1619 | { |
1620 | struct nfsd4_slot *slot = resp->cstate.slot; | 1620 | struct nfsd4_slot *slot = resp->cstate.slot; |
1621 | struct kvec *head = resp->xdr.iov; | ||
1621 | __be32 status; | 1622 | __be32 status; |
1622 | 1623 | ||
1623 | dprintk("--> %s slot %p\n", __func__, slot); | 1624 | dprintk("--> %s slot %p\n", __func__, slot); |
@@ -1631,6 +1632,8 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, | |||
1631 | 1632 | ||
1632 | resp->opcnt = slot->sl_opcnt; | 1633 | resp->opcnt = slot->sl_opcnt; |
1633 | resp->xdr.p = resp->cstate.datap + XDR_QUADLEN(slot->sl_datalen); | 1634 | resp->xdr.p = resp->cstate.datap + XDR_QUADLEN(slot->sl_datalen); |
1635 | head->iov_len = (void *)resp->xdr.p - head->iov_base; | ||
1636 | resp->xdr.buf->len = head->iov_len; | ||
1634 | status = slot->sl_status; | 1637 | status = slot->sl_status; |
1635 | 1638 | ||
1636 | return status; | 1639 | return status; |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index e9abf5f66e8b..79b8e1ef0f39 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -3789,19 +3789,13 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compo | |||
3789 | * All that remains is to write the tag and operation count... | 3789 | * All that remains is to write the tag and operation count... |
3790 | */ | 3790 | */ |
3791 | struct nfsd4_compound_state *cs = &resp->cstate; | 3791 | struct nfsd4_compound_state *cs = &resp->cstate; |
3792 | struct kvec *iov; | 3792 | |
3793 | p = resp->tagp; | 3793 | p = resp->tagp; |
3794 | *p++ = htonl(resp->taglen); | 3794 | *p++ = htonl(resp->taglen); |
3795 | memcpy(p, resp->tag, resp->taglen); | 3795 | memcpy(p, resp->tag, resp->taglen); |
3796 | p += XDR_QUADLEN(resp->taglen); | 3796 | p += XDR_QUADLEN(resp->taglen); |
3797 | *p++ = htonl(resp->opcnt); | 3797 | *p++ = htonl(resp->opcnt); |
3798 | 3798 | ||
3799 | if (rqstp->rq_res.page_len) | ||
3800 | iov = &rqstp->rq_res.tail[0]; | ||
3801 | else | ||
3802 | iov = &rqstp->rq_res.head[0]; | ||
3803 | iov->iov_len = ((char *)resp->xdr.p) - (char *)iov->iov_base; | ||
3804 | BUG_ON(iov->iov_len > PAGE_SIZE); | ||
3805 | if (nfsd4_has_session(cs)) { | 3799 | if (nfsd4_has_session(cs)) { |
3806 | struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); | 3800 | struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); |
3807 | struct nfs4_client *clp = cs->session->se_client; | 3801 | struct nfs4_client *clp = cs->session->se_client; |