diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2022-07-08 14:25:50 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-07-29 20:11:42 -0400 |
commit | 8755326399f471ec3b31e2ab8c5074c0d28a0fb5 (patch) | |
tree | 03dbc15c052261091ae3ba292933bcc4827dbddf /fs/nfsd/filecache.c | |
parent | f53cef15dddec7203df702cdc62e554190385450 (diff) | |
download | linux-8755326399f471ec3b31e2ab8c5074c0d28a0fb5.tar.gz |
NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode
Remove an unnecessary usage of nf_hashval.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/filecache.c')
-rw-r--r-- | fs/nfsd/filecache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 92e3e7d4fcd1..a9034d87f006 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -273,13 +273,17 @@ static void nfsd_file_lru_remove(struct nfsd_file *nf) static void nfsd_file_do_unhash(struct nfsd_file *nf) { - lockdep_assert_held(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock); + struct inode *inode = nf->nf_inode; + unsigned int hashval = (unsigned int)hash_long(inode->i_ino, + NFSD_FILE_HASH_BITS); + + lockdep_assert_held(&nfsd_file_hashtbl[hashval].nfb_lock); trace_nfsd_file_unhash(nf); if (nfsd_file_check_write_error(nf)) nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); - --nfsd_file_hashtbl[nf->nf_hashval].nfb_count; + --nfsd_file_hashtbl[hashval].nfb_count; hlist_del_rcu(&nf->nf_node); atomic_long_dec(&nfsd_filecache_count); } |