Commit cb7ec76e authored by Chuck Lever's avatar Chuck Lever

NFSD: nfsd_file_hash_remove can compute hashval

Remove an unnecessary use of nf_hashval.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent a8455110
...@@ -288,6 +288,18 @@ nfsd_file_do_unhash(struct nfsd_file *nf) ...@@ -288,6 +288,18 @@ nfsd_file_do_unhash(struct nfsd_file *nf)
atomic_long_dec(&nfsd_filecache_count); atomic_long_dec(&nfsd_filecache_count);
} }
static void
nfsd_file_hash_remove(struct nfsd_file *nf)
{
struct inode *inode = nf->nf_inode;
unsigned int hashval = (unsigned int)hash_long(inode->i_ino,
NFSD_FILE_HASH_BITS);
spin_lock(&nfsd_file_hashtbl[hashval].nfb_lock);
nfsd_file_do_unhash(nf);
spin_unlock(&nfsd_file_hashtbl[hashval].nfb_lock);
}
static bool static bool
nfsd_file_unhash(struct nfsd_file *nf) nfsd_file_unhash(struct nfsd_file *nf)
{ {
...@@ -507,11 +519,8 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose) ...@@ -507,11 +519,8 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose)
{ {
struct nfsd_file *nf; struct nfsd_file *nf;
list_for_each_entry(nf, dispose, nf_lru) { list_for_each_entry(nf, dispose, nf_lru)
spin_lock(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock); nfsd_file_hash_remove(nf);
nfsd_file_do_unhash(nf);
spin_unlock(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock);
}
nfsd_file_dispose_list_delayed(dispose); nfsd_file_dispose_list_delayed(dispose);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment