struct nfsd_readdirargs *argp = rqstp->rq_argp;
struct nfsd_readdirres *resp = rqstp->rq_resp;
loff_t offset;
- __be32 *buffer;
dprintk("nfsd: READDIR %s %d bytes at %d\n",
SVCFH_fmt(&argp->fh),
argp->count, argp->cookie);
nfsd_init_dirlist_pages(rqstp, resp, argp->count);
- buffer = resp->buffer;
resp->offset = NULL;
resp->common.err = nfs_ok;
offset = argp->cookie;
resp->status = nfsd_readdir(rqstp, &argp->fh, &offset,
&resp->common, nfssvc_encode_entry);
-
- resp->count = resp->buffer - buffer;
nfssvc_encode_nfscookie(resp, offset);
fh_put(&argp->fh);
p = resp->buffer;
*p++ = 0; /* no more entries */
*p++ = htonl((resp->common.err == nfserr_eof));
- rqstp->rq_res.page_len = (((unsigned long)p-1) & ~PAGE_MASK)+1;
+ rqstp->rq_res.page_len = resp->count << 2;
return 1;
}
cd->offset = p; /* remember pointer */
*p++ = htonl(~0U); /* offset of next entry */
+ cd->count += p - cd->buffer;
cd->buflen = buflen;
cd->buffer = p;
cd->common.err = nfs_ok;