aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-01-24 12:11:02 -0500
committerJ. Bruce Fields <bfields@redhat.com>2011-07-18 09:39:01 -0400
commit1091006c5eb15cba56785bd5b498a8d0b9546903 (patch)
treeb51fad1bb57284b3eea4308c02652c4888b85860 /fs/nfsd/nfssvc.c
parent3e98abffd1665b884a322aedcd528577842f762f (diff)
nfsd: turn on reply cache for NFSv4
It's sort of ridiculous that we've never had a working reply cache for NFSv4. On the other hand, we may still not: our current reply cache is likely not very good, especially in the TCP case (which is the only case that matters for v4). What we really need here is some serious testing. Anyway, here's a start. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r--fs/nfsd/nfssvc.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index bb8397f9da25..dc5a1bf476b1 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -570,8 +570,22 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
570 rqstp->rq_vers, rqstp->rq_proc); 570 rqstp->rq_vers, rqstp->rq_proc);
571 proc = rqstp->rq_procinfo; 571 proc = rqstp->rq_procinfo;
572 572
573 /*
574 * Give the xdr decoder a chance to change this if it wants
575 * (necessary in the NFSv4.0 compound case)
576 */
577 rqstp->rq_cachetype = proc->pc_cachetype;
578 /* Decode arguments */
579 xdr = proc->pc_decode;
580 if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base,
581 rqstp->rq_argp)) {
582 dprintk("nfsd: failed to decode arguments!\n");
583 *statp = rpc_garbage_args;
584 return 1;
585 }
586
573 /* Check whether we have this call in the cache. */ 587 /* Check whether we have this call in the cache. */
574 switch (nfsd_cache_lookup(rqstp, proc->pc_cachetype)) { 588 switch (nfsd_cache_lookup(rqstp)) {
575 case RC_INTR: 589 case RC_INTR:
576 case RC_DROPIT: 590 case RC_DROPIT:
577 return 0; 591 return 0;
@@ -581,16 +595,6 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
581 /* do it */ 595 /* do it */
582 } 596 }
583 597
584 /* Decode arguments */
585 xdr = proc->pc_decode;
586 if (xdr && !xdr(rqstp, (__be32*)rqstp->rq_arg.head[0].iov_base,
587 rqstp->rq_argp)) {
588 dprintk("nfsd: failed to decode arguments!\n");
589 nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
590 *statp = rpc_garbage_args;
591 return 1;
592 }
593
594 /* need to grab the location to store the status, as 598 /* need to grab the location to store the status, as
595 * nfsv4 does some encoding while processing 599 * nfsv4 does some encoding while processing
596 */ 600 */