]> www.infradead.org Git - users/dwmw2/linux.git/commit
NFSD: Clean up find_or_add_file()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 28 Oct 2022 14:47:41 +0000 (10:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:22 +0000 (16:19 +0200)
commit2b03fd9fe4bc2d2ca53cf8d07d4bef6c0c1dff02
tree8d6c2e64140c140cb5efaf5a69459fb1384d2820
parentd02c59ebe05805a9f373689b585694e0d75a80a1
NFSD: Clean up find_or_add_file()

[ Upstream commit 9270fc514ba7d415636b23bcb937573a1ce54f6a ]

Remove the call to find_file_locked() in insert_nfs4_file(). Tracing
shows that over 99% of these calls return NULL. Thus it is not worth
the expense of the extra bucket list traversal. insert_file() already
deals correctly with the case where the item is already in the hash
bucket.

Since nfsd4_file_hash_insert() is now just a wrapper around
insert_file(), move the meat of insert_file() into
nfsd4_file_hash_insert() and get rid of it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c