aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.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/nfs4xdr.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/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index c43f56021501..c8bf405d19de 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -52,6 +52,7 @@
52#include "xdr4.h" 52#include "xdr4.h"
53#include "vfs.h" 53#include "vfs.h"
54#include "state.h" 54#include "state.h"
55#include "cache.h"
55 56
56#define NFSDDBG_FACILITY NFSDDBG_XDR 57#define NFSDDBG_FACILITY NFSDDBG_XDR
57 58
@@ -1466,6 +1467,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1466 DECODE_HEAD; 1467 DECODE_HEAD;
1467 struct nfsd4_op *op; 1468 struct nfsd4_op *op;
1468 struct nfsd4_minorversion_ops *ops; 1469 struct nfsd4_minorversion_ops *ops;
1470 bool cachethis = false;
1469 int i; 1471 int i;
1470 1472
1471 /* 1473 /*
@@ -1547,7 +1549,16 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1547 argp->opcnt = i+1; 1549 argp->opcnt = i+1;
1548 break; 1550 break;
1549 } 1551 }
1552 /*
1553 * We'll try to cache the result in the DRC if any one
1554 * op in the compound wants to be cached:
1555 */
1556 cachethis |= nfsd4_cache_this_op(op);
1550 } 1557 }
1558 /* Sessions make the DRC unnecessary: */
1559 if (argp->minorversion)
1560 cachethis = false;
1561 argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE;
1551 1562
1552 DECODE_TAIL; 1563 DECODE_TAIL;
1553} 1564}