Skip to content

Commit

Permalink
nfsd4: minor encode_read cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed May 30, 2014
1 parent 4f0cefb commit 6ff9897
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3076,18 +3076,20 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr,

len = maxcount;
v = 0;
while (len > 0) {
while (len) {
int thislen;

page = *(resp->rqstp->rq_next_page);
if (!page) { /* ran out of pages */
maxcount -= len;
break;
}
thislen = min_t(long, len, PAGE_SIZE);
resp->rqstp->rq_vec[v].iov_base = page_address(page);
resp->rqstp->rq_vec[v].iov_len =
len < PAGE_SIZE ? len : PAGE_SIZE;
resp->rqstp->rq_vec[v].iov_len = thislen;
resp->rqstp->rq_next_page++;
v++;
len -= PAGE_SIZE;
len -= thislen;
}
read->rd_vlen = v;

Expand Down

0 comments on commit 6ff9897

Please sign in to comment.