NFSD: Clean up find_or_add_file()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 28 Oct 2022 14:47:41 +0000 (10:47 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 28 Nov 2022 17:54:47 +0000 (12:54 -0500)
commit9270fc514ba7d415636b23bcb937573a1ce54f6a
tree0162d687536877f79d9088d5da3b5749a0b0a47a
parent3341678f2fd6106055cead09e513fad6950a0d19
NFSD: Clean up find_or_add_file()

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>
fs/nfsd/nfs4state.c