Skip to content

Commit ed9887b

Browse files
JuliaLawallchucklever
authored andcommitted
nfsd: replace call_rcu by kfree_rcu for simple kmem_cache_free callback
Since SLOB was removed and since commit 6c6c47b ("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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent a32442f commit ed9887b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

fs/nfsd/nfs4state.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,21 +572,14 @@ opaque_hashval(const void *ptr, int nbytes)
572572
return x;
573573
}
574574

575-
static void nfsd4_free_file_rcu(struct rcu_head *rcu)
576-
{
577-
struct nfs4_file *fp = container_of(rcu, struct nfs4_file, fi_rcu);
578-
579-
kmem_cache_free(file_slab, fp);
580-
}
581-
582575
void
583576
put_nfs4_file(struct nfs4_file *fi)
584577
{
585578
if (refcount_dec_and_test(&fi->fi_ref)) {
586579
nfsd4_file_hash_remove(fi);
587580
WARN_ON_ONCE(!list_empty(&fi->fi_clnt_odstate));
588581
WARN_ON_ONCE(!list_empty(&fi->fi_delegations));
589-
call_rcu(&fi->fi_rcu, nfsd4_free_file_rcu);
582+
kfree_rcu(fi, fi_rcu);
590583
}
591584
}
592585

0 commit comments

Comments
 (0)