aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
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
parent0338dd157282c19696d3c32614a748d0ba814b12 (diff)
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')
-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 d213e6e69e46..69d29d4ea579 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -21,7 +21,6 @@
21 21
22static struct hlist_head * cache_hash; 22static struct hlist_head * cache_hash;
23static struct list_head lru_head; 23static struct list_head lru_head;
24static int cache_disabled = 1;
25static struct kmem_cache *drc_slab; 24static struct kmem_cache *drc_slab;
26static unsigned int num_drc_entries; 25static unsigned int num_drc_entries;
27static unsigned int max_drc_entries; 26static unsigned int max_drc_entries;
@@ -113,7 +112,6 @@ int nfsd_reply_cache_init(void)
113 INIT_LIST_HEAD(&lru_head); 112 INIT_LIST_HEAD(&lru_head);
114 max_drc_entries = nfsd_cache_size_limit(); 113 max_drc_entries = nfsd_cache_size_limit();
115 num_drc_entries = 0; 114 num_drc_entries = 0;
116 cache_disabled = 0;
117 return 0; 115 return 0;
118out_nomem: 116out_nomem:
119 printk(KERN_ERR "nfsd: failed to allocate reply cache\n"); 117 printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
@@ -130,8 +128,6 @@ void nfsd_reply_cache_shutdown(void)
130 nfsd_reply_cache_free_locked(rp); 128 nfsd_reply_cache_free_locked(rp);
131 } 129 }
132 130
133 cache_disabled = 1;
134
135 kfree (cache_hash); 131 kfree (cache_hash);
136 cache_hash = NULL; 132 cache_hash = NULL;
137 133
@@ -215,7 +211,7 @@ nfsd_cache_lookup(struct svc_rqst *rqstp)
215 int rtn; 211 int rtn;
216 212
217 rqstp->rq_cacherep = NULL; 213 rqstp->rq_cacherep = NULL;
218 if (cache_disabled || type == RC_NOCACHE) { 214 if (type == RC_NOCACHE) {
219 nfsdstats.rcnocache++; 215 nfsdstats.rcnocache++;
220 return RC_DOIT; 216 return RC_DOIT;
221 } 217 }
@@ -345,11 +341,11 @@ found_entry:
345void 341void
346nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp) 342nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
347{ 343{
348 struct svc_cacherep *rp; 344 struct svc_cacherep *rp = rqstp->rq_cacherep;
349 struct kvec *resv = &rqstp->rq_res.head[0], *cachv; 345 struct kvec *resv = &rqstp->rq_res.head[0], *cachv;
350 int len; 346 int len;
351 347
352 if (!(rp = rqstp->rq_cacherep) || cache_disabled) 348 if (!rp)
353 return; 349 return;
354 350
355 len = resv->iov_len - ((char*)statp - (char*)resv->iov_base); 351 len = resv->iov_len - ((char*)statp - (char*)resv->iov_base);