]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfsd: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
authorJulia Lawall <Julia.Lawall@inria.fr>
Sun, 13 Oct 2024 20:16:59 +0000 (22:16 +0200)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 19 Nov 2024 01:23:00 +0000 (20:23 -0500)
Since SLOB was removed and since
commit 6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"),
it is not necessary to use call_rcu when the callback only performs
kmem_cache_free. Use kfree_rcu() directly.

The changes were made using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c

index 2f229d007b586e13e090553acb4102e48b133afe..291db55c90e4906bf5c1e0a4986520b7d8b7dcd2 100644 (file)
@@ -572,13 +572,6 @@ opaque_hashval(const void *ptr, int nbytes)
        return x;
 }
 
-static void nfsd4_free_file_rcu(struct rcu_head *rcu)
-{
-       struct nfs4_file *fp = container_of(rcu, struct nfs4_file, fi_rcu);
-
-       kmem_cache_free(file_slab, fp);
-}
-
 void
 put_nfs4_file(struct nfs4_file *fi)
 {
@@ -586,7 +579,7 @@ put_nfs4_file(struct nfs4_file *fi)
                nfsd4_file_hash_remove(fi);
                WARN_ON_ONCE(!list_empty(&fi->fi_clnt_odstate));
                WARN_ON_ONCE(!list_empty(&fi->fi_delegations));
-               call_rcu(&fi->fi_rcu, nfsd4_free_file_rcu);
+               kfree_rcu(fi, fi_rcu);
        }
 }