summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-11-06 05:00:35 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-11-06 05:00:35 -0800
commit835a922a7bb73dc00c7186384e41ebd243f13c7d (patch)
tree972610c3a87336341b0c0eb7d5aa206abe0120cc /include/linux/sunrpc
parent032d360766dcaa3efcd537ce956ed425a98e1440 (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/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/svc.h13
1 files changed, 13 insertions, 0 deletions
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) {