aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-04-03 01:28:15 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-03 20:41:17 -0400
commit074fe897536f095309c5aaffcf912952882ab2cb (patch)
treed4bb2fff645a2df1dbdec4af6787359d888a3695 /fs/nfsd/nfssvc.c
parentf9bb94c4c60f6e1d1717077bfddb614f03a607d1 (diff)
nfsd41: DRC save, restore, and clear functions
Cache all the result pages, including the rpc header in rq_respages[0], for a request in the slot table cache entry. Cache the statp pointer from nfsd_dispatch which points into rq_respages[0] just past the rpc header. When setting a cache entry, calculate and save the length of the nfs data minus the rpc header for rq_respages[0]. When replaying a cache entry, replace the cached rpc header with the replayed request rpc result header, unless there is not enough room in the cached results first page. In that case, use the cached rpc header. The sessions fore channel maxresponse size cached is set to NFSD_PAGES_PER_SLOT * PAGE_SIZE. For compounds we are cacheing with operations such as READDIR that use the xdr_buf->pages to hold data, we choose to cache the extra page of data rather than copying data from xdr_buf->pages into the xdr_buf->head page. [nfsd41: limit cache to maxresponsesize_cached] [nfsd41: mv nfsd4_set_statp under CONFIG_NFSD_V4_1] [nfsd41: rename nfsd4_move_pages] [nfsd41: rename page_no variable] [nfsd41: rename nfsd4_set_cache_entry] [nfsd41: fix nfsd41_copy_replay_data comment] [nfsd41: add to nfsd4_set_cache_entry] Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r--fs/nfsd/nfssvc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index ef0a3686639d..b5168d1898ec 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -515,6 +515,10 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
515 + rqstp->rq_res.head[0].iov_len; 515 + rqstp->rq_res.head[0].iov_len;
516 rqstp->rq_res.head[0].iov_len += sizeof(__be32); 516 rqstp->rq_res.head[0].iov_len += sizeof(__be32);
517 517
518 /* NFSv4.1 DRC requires statp */
519 if (rqstp->rq_vers == 4)
520 nfsd4_set_statp(rqstp, statp);
521
518 /* Now call the procedure handler, and encode NFS status. */ 522 /* Now call the procedure handler, and encode NFS status. */
519 nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp); 523 nfserr = proc->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
520 nfserr = map_new_errors(rqstp->rq_vers, nfserr); 524 nfserr = map_new_errors(rqstp->rq_vers, nfserr);