diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2002-11-06 05:00:35 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-11-06 05:00:35 -0800 |
| commit | 835a922a7bb73dc00c7186384e41ebd243f13c7d (patch) | |
| tree | 972610c3a87336341b0c0eb7d5aa206abe0120cc /include | |
| parent | 032d360766dcaa3efcd537ce956ed425a98e1440 (diff) | |
[PATCH] kNFSd: Support zero-copy read for NFSD
From Hirokazu Takahashi <taka@valinux.co.jp>
This patch changes read and readdir in nfsd.
read:
If the file supports readpage, we use it to collect pages out of the page
cache and to attache them directly to the outgoing nfs reply.
The reduces the number of copies by one, and if the filesystem/device
driver didn't copy the data, and if the network card can support not copying
the data, then you get zero-copy reads.
readdir:
A separate page is used for stoing the readdir response so that a fill
PAGE_SIZE bytes of reply can be supported.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/nfsd/xdr.h | 1 | ||||
| -rw-r--r-- | include/linux/nfsd/xdr3.h | 1 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h index 97078834e430..1284b9fc42f5 100644 --- a/include/linux/nfsd/xdr.h +++ b/include/linux/nfsd/xdr.h @@ -77,6 +77,7 @@ struct nfsd_readdirargs { struct svc_fh fh; __u32 cookie; __u32 count; + u32 * buffer; }; struct nfsd_attrstat { diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index 1576a6db4a17..ae0d843b4d54 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h @@ -96,6 +96,7 @@ struct nfsd3_readdirargs { __u32 dircount; __u32 count; __u32 * verf; + u32 * buffer; }; struct nfsd3_commitargs { diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 2fa53b11e52c..3abd896c0787 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -192,6 +192,19 @@ static void inline svc_pushback_allpages(struct svc_rqst *rqstp) } } +static void inline svc_pushback_unused_pages(struct svc_rqst *rqstp) +{ + while (rqstp->rq_resused) { + if (rqstp->rq_respages[--rqstp->rq_resused] != NULL) { + rqstp->rq_argpages[rqstp->rq_arghi++] = + rqstp->rq_respages[rqstp->rq_resused]; + rqstp->rq_respages[rqstp->rq_resused] = NULL; + } + if (rqstp->rq_res.pages == &rqstp->rq_respages[rqstp->rq_resused]) + break; + } +} + static void inline svc_free_allpages(struct svc_rqst *rqstp) { while (rqstp->rq_resused) { |
