NFSD: Clean up unused code after rhashtable conversion
[ Upstream commit 0ec8e9d1539a7b8109a554028bbce441052f847e ] Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
fb4d9b9e07
commit
8135682ff8
2 changed files with 1 additions and 33 deletions
|
@ -21,11 +21,6 @@
|
|||
#include "filecache.h"
|
||||
#include "trace.h"
|
||||
|
||||
#define NFSDDBG_FACILITY NFSDDBG_FH
|
||||
|
||||
/* FIXME: dynamically size this for the machine somehow? */
|
||||
#define NFSD_FILE_HASH_BITS 12
|
||||
#define NFSD_FILE_HASH_SIZE (1 << NFSD_FILE_HASH_BITS)
|
||||
#define NFSD_LAUNDRETTE_DELAY (2 * HZ)
|
||||
|
||||
#define NFSD_FILE_CACHE_UP (0)
|
||||
|
@ -33,13 +28,6 @@
|
|||
/* We only care about NFSD_MAY_READ/WRITE for this cache */
|
||||
#define NFSD_FILE_MAY_MASK (NFSD_MAY_READ|NFSD_MAY_WRITE)
|
||||
|
||||
struct nfsd_fcache_bucket {
|
||||
struct hlist_head nfb_head;
|
||||
spinlock_t nfb_lock;
|
||||
unsigned int nfb_count;
|
||||
unsigned int nfb_maxcount;
|
||||
};
|
||||
|
||||
static DEFINE_PER_CPU(unsigned long, nfsd_file_cache_hits);
|
||||
static DEFINE_PER_CPU(unsigned long, nfsd_file_acquisitions);
|
||||
static DEFINE_PER_CPU(unsigned long, nfsd_file_releases);
|
||||
|
@ -57,7 +45,6 @@ static struct workqueue_struct *nfsd_filecache_wq __read_mostly;
|
|||
|
||||
static struct kmem_cache *nfsd_file_slab;
|
||||
static struct kmem_cache *nfsd_file_mark_slab;
|
||||
static struct nfsd_fcache_bucket *nfsd_file_hashtbl;
|
||||
static struct list_lru nfsd_file_lru;
|
||||
static unsigned long nfsd_file_flags;
|
||||
static struct fsnotify_group *nfsd_file_fsnotify_group;
|
||||
|
@ -302,7 +289,6 @@ nfsd_file_alloc(struct nfsd_file_lookup_key *key, unsigned int may)
|
|||
|
||||
nf = kmem_cache_alloc(nfsd_file_slab, GFP_KERNEL);
|
||||
if (nf) {
|
||||
INIT_HLIST_NODE(&nf->nf_node);
|
||||
INIT_LIST_HEAD(&nf->nf_lru);
|
||||
nf->nf_birthtime = ktime_get();
|
||||
nf->nf_file = NULL;
|
||||
|
@ -810,8 +796,7 @@ static const struct fsnotify_ops nfsd_file_fsnotify_ops = {
|
|||
int
|
||||
nfsd_file_cache_init(void)
|
||||
{
|
||||
int ret;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&nfsd_mutex);
|
||||
if (test_and_set_bit(NFSD_FILE_CACHE_UP, &nfsd_file_flags) == 1)
|
||||
|
@ -826,13 +811,6 @@ nfsd_file_cache_init(void)
|
|||
if (!nfsd_filecache_wq)
|
||||
goto out;
|
||||
|
||||
nfsd_file_hashtbl = kvcalloc(NFSD_FILE_HASH_SIZE,
|
||||
sizeof(*nfsd_file_hashtbl), GFP_KERNEL);
|
||||
if (!nfsd_file_hashtbl) {
|
||||
pr_err("nfsd: unable to allocate nfsd_file_hashtbl\n");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
nfsd_file_slab = kmem_cache_create("nfsd_file",
|
||||
sizeof(struct nfsd_file), 0, 0, NULL);
|
||||
if (!nfsd_file_slab) {
|
||||
|
@ -876,11 +854,6 @@ nfsd_file_cache_init(void)
|
|||
goto out_notifier;
|
||||
}
|
||||
|
||||
for (i = 0; i < NFSD_FILE_HASH_SIZE; i++) {
|
||||
INIT_HLIST_HEAD(&nfsd_file_hashtbl[i].nfb_head);
|
||||
spin_lock_init(&nfsd_file_hashtbl[i].nfb_lock);
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&nfsd_filecache_laundrette, nfsd_file_gc_worker);
|
||||
out:
|
||||
return ret;
|
||||
|
@ -895,8 +868,6 @@ out_err:
|
|||
nfsd_file_slab = NULL;
|
||||
kmem_cache_destroy(nfsd_file_mark_slab);
|
||||
nfsd_file_mark_slab = NULL;
|
||||
kvfree(nfsd_file_hashtbl);
|
||||
nfsd_file_hashtbl = NULL;
|
||||
destroy_workqueue(nfsd_filecache_wq);
|
||||
nfsd_filecache_wq = NULL;
|
||||
rhashtable_destroy(&nfsd_file_rhash_tbl);
|
||||
|
@ -1026,8 +997,6 @@ nfsd_file_cache_shutdown(void)
|
|||
fsnotify_wait_marks_destroyed();
|
||||
kmem_cache_destroy(nfsd_file_mark_slab);
|
||||
nfsd_file_mark_slab = NULL;
|
||||
kvfree(nfsd_file_hashtbl);
|
||||
nfsd_file_hashtbl = NULL;
|
||||
destroy_workqueue(nfsd_filecache_wq);
|
||||
nfsd_filecache_wq = NULL;
|
||||
rhashtable_destroy(&nfsd_file_rhash_tbl);
|
||||
|
|
|
@ -30,7 +30,6 @@ struct nfsd_file_mark {
|
|||
*/
|
||||
struct nfsd_file {
|
||||
struct rhash_head nf_rhash;
|
||||
struct hlist_node nf_node;
|
||||
struct list_head nf_lru;
|
||||
struct rcu_head nf_rcu;
|
||||
struct file *nf_file;
|
||||
|
|
Loading…
Add table
Reference in a new issue