NFSD: Refactor nfsd_reply_cache_free_locked()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 9 Jul 2023 15:45:16 +0000 (11:45 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 29 Aug 2023 21:45:22 +0000 (17:45 -0400)
commit35308e7f0fc3942edc87d9c6dc78c4a096428957
tree7602c16df0152088c0f6556b20b9ec03edcb6c83
parent2a9893f796a3d5098dd13eae9c2cf8e2f6de5b25
NFSD: Refactor nfsd_reply_cache_free_locked()

To reduce contention on the bucket locks, we must avoid calling
kfree() while each bucket lock is held.

Start by refactoring nfsd_reply_cache_free_locked() into a helper
that removes an entry from the bucket (and must therefore run under
the lock) and a second helper that frees the entry (which does not
need to hold the lock).

For readability, rename the helpers nfsd_cacherep_<verb>.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfscache.c