Skip to content

Commit 8755326

Browse files
committed
NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode
Remove an unnecessary usage of nf_hashval. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent f53cef1 commit 8755326

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/nfsd/filecache.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,17 @@ static void nfsd_file_lru_remove(struct nfsd_file *nf)
273273
static void
274274
nfsd_file_do_unhash(struct nfsd_file *nf)
275275
{
276-
lockdep_assert_held(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock);
276+
struct inode *inode = nf->nf_inode;
277+
unsigned int hashval = (unsigned int)hash_long(inode->i_ino,
278+
NFSD_FILE_HASH_BITS);
279+
280+
lockdep_assert_held(&nfsd_file_hashtbl[hashval].nfb_lock);
277281

278282
trace_nfsd_file_unhash(nf);
279283

280284
if (nfsd_file_check_write_error(nf))
281285
nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id));
282-
--nfsd_file_hashtbl[nf->nf_hashval].nfb_count;
286+
--nfsd_file_hashtbl[hashval].nfb_count;
283287
hlist_del_rcu(&nf->nf_node);
284288
atomic_long_dec(&nfsd_filecache_count);
285289
}

0 commit comments

Comments
 (0)