Commit 071ae99f authored by Chuck Lever's avatar Chuck Lever

NFSD: Simplify starting_len

Clean-up: Now that nfsd4_encode_readv() does not have to encode the
EOF or rd_length values, it no longer needs to subtract 8 from
@starting_len.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 28d5bc46
...@@ -3939,7 +3939,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, ...@@ -3939,7 +3939,7 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
struct file *file, unsigned long maxcount) struct file *file, unsigned long maxcount)
{ {
struct xdr_stream *xdr = resp->xdr; struct xdr_stream *xdr = resp->xdr;
int starting_len = xdr->buf->len - 8; unsigned int starting_len = xdr->buf->len;
__be32 nfserr; __be32 nfserr;
__be32 tmp; __be32 tmp;
int pad; int pad;
...@@ -3954,14 +3954,13 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, ...@@ -3954,14 +3954,13 @@ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp,
read->rd_length = maxcount; read->rd_length = maxcount;
if (nfserr) if (nfserr)
return nfserr; return nfserr;
if (svc_encode_result_payload(resp->rqstp, starting_len + 8, maxcount)) if (svc_encode_result_payload(resp->rqstp, starting_len, maxcount))
return nfserr_io; return nfserr_io;
xdr_truncate_encode(xdr, starting_len + 8 + xdr_align_size(maxcount)); xdr_truncate_encode(xdr, starting_len + xdr_align_size(maxcount));
tmp = xdr_zero; tmp = xdr_zero;
pad = (maxcount&3) ? 4 - (maxcount&3) : 0; pad = (maxcount&3) ? 4 - (maxcount&3) : 0;
write_bytes_to_xdr_buf(xdr->buf, starting_len + 8 + maxcount, write_bytes_to_xdr_buf(xdr->buf, starting_len + maxcount, &tmp, pad);
&tmp, pad);
return 0; return 0;
} }
......
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