Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nfsd: replace call_rcu by kfree_rcu for simple kmem_cache_free callback

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>

authored by

Julia Lawall and committed by
Chuck Lever
ed9887b8 a32442f6

+1 -8
+1 -8
fs/nfsd/nfs4state.c
··· 572 572 return x; 573 573 } 574 574 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 - 582 575 void 583 576 put_nfs4_file(struct nfs4_file *fi) 584 577 { ··· 579 586 nfsd4_file_hash_remove(fi); 580 587 WARN_ON_ONCE(!list_empty(&fi->fi_clnt_odstate)); 581 588 WARN_ON_ONCE(!list_empty(&fi->fi_delegations)); 582 - call_rcu(&fi->fi_rcu, nfsd4_free_file_rcu); 589 + kfree_rcu(fi, fi_rcu); 583 590 } 584 591 } 585 592