diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-02-04 08:18:03 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-02-04 17:19:11 -0500 |
commit | 13cc8a78e89db0469e67ac9b3ae466b661af93fa (patch) | |
tree | db2c409da53cd30c372ca6af147c62dc7db0fc95 /fs/nfsd | |
parent | 0338dd157282c19696d3c32614a748d0ba814b12 (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.c | 10 |
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 | ||
22 | static struct hlist_head * cache_hash; | 22 | static struct hlist_head * cache_hash; |
23 | static struct list_head lru_head; | 23 | static struct list_head lru_head; |
24 | static int cache_disabled = 1; | ||
25 | static struct kmem_cache *drc_slab; | 24 | static struct kmem_cache *drc_slab; |
26 | static unsigned int num_drc_entries; | 25 | static unsigned int num_drc_entries; |
27 | static unsigned int max_drc_entries; | 26 | static 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; |
118 | out_nomem: | 116 | out_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: | |||
345 | void | 341 | void |
346 | nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp) | 342 | nfsd_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); |