summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfscache.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-02-04 08:18:03 -0500
committerJ. Bruce Fields <bfields@redhat.com>2013-02-04 17:19:11 -0500
commit13cc8a78e89db0469e67ac9b3ae466b661af93fa (patch)
treedb2c409da53cd30c372ca6af147c62dc7db0fc95 /fs/nfsd/nfscache.c
parent0338dd157282c19696d3c32614a748d0ba814b12 (diff)
downloadop-kernel-dev-13cc8a78e89db0469e67ac9b3ae466b661af93fa.zip
op-kernel-dev-13cc8a78e89db0469e67ac9b3ae466b661af93fa.tar.gz
nfsd: remove the cache_disabled flag
With the change to dynamically allocate entries, the cache is never disabled on the fly. Remove this flag. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfscache.c')
-rw-r--r--fs/nfsd/nfscache.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index d213e6e..69d29d4 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -21,7 +21,6 @@
static struct hlist_head * cache_hash;
static struct list_head lru_head;
-static int cache_disabled = 1;
static struct kmem_cache *drc_slab;
static unsigned int num_drc_entries;
static unsigned int max_drc_entries;
@@ -113,7 +112,6 @@ int nfsd_reply_cache_init(void)
INIT_LIST_HEAD(&lru_head);
max_drc_entries = nfsd_cache_size_limit();
num_drc_entries = 0;
- cache_disabled = 0;
return 0;
out_nomem:
printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
@@ -130,8 +128,6 @@ void nfsd_reply_cache_shutdown(void)
nfsd_reply_cache_free_locked(rp);
}
- cache_disabled = 1;
-
kfree (cache_hash);
cache_hash = NULL;
@@ -215,7 +211,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
int rtn;
rqstp->rq_cacherep = NULL;
- if (cache_disabled || type == RC_NOCACHE) {
+ if (type == RC_NOCACHE) {
nfsdstats.rcnocache++;
return RC_DOIT;
}
@@ -345,11 +341,11 @@ found_entry:
void
nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
{
- struct svc_cacherep *rp;
+ struct svc_cacherep *rp = rqstp->rq_cacherep;
struct kvec *resv = &rqstp->rq_res.head[0], *cachv;
int len;
- if (!(rp = rqstp->rq_cacherep) || cache_disabled)
+ if (!rp)
return;
len = resv->iov_len - ((char*)statp - (char*)resv->iov_base);
OpenPOWER on IntegriCloud