Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25584
b: refs/heads/master
c: bb6e8a9
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Apr 11, 2006
1 parent 7b24ab3 commit 6ff50ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ed6decccf544970664757464cfb67e081775e6a
refs/heads/master: bb6e8a9f4005237401a45f1ea43db060ea5f9725
13 changes: 6 additions & 7 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
{
int maxcount;
loff_t offset;
u32 *page, *savep;
u32 *page, *savep, *tailbase;
ENCODE_HEAD;

if (nfserr)
Expand All @@ -2173,6 +2173,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
WRITE32(0);
ADJUST_ARGS();
resp->xbuf->head[0].iov_len = ((char*)resp->p) - (char*)resp->xbuf->head[0].iov_base;
tailbase = p;

maxcount = PAGE_SIZE;
if (maxcount > readdir->rd_maxcount)
Expand Down Expand Up @@ -2217,14 +2218,12 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
*p++ = htonl(readdir->common.err == nfserr_eof);
resp->xbuf->page_len = ((char*)p) - (char*)page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused-1]);

/* allocate a page for the tail */
svc_take_page(resp->rqstp);
resp->xbuf->tail[0].iov_base =
page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused-1]);
resp->rqstp->rq_restailpage = resp->rqstp->rq_resused-1;
/* Use rest of head for padding and remaining ops: */
resp->rqstp->rq_restailpage = 0;
resp->xbuf->tail[0].iov_base = tailbase;
resp->xbuf->tail[0].iov_len = 0;
resp->p = resp->xbuf->tail[0].iov_base;
resp->end = resp->p + PAGE_SIZE/4;
resp->end = resp->p + (PAGE_SIZE - resp->xbuf->head[0].iov_len)/4;

return 0;
err_no_verf:
Expand Down

0 comments on commit 6ff50ff

Please sign in to comment.