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

net,rcu: convert call_rcu(tcf_common_free_rcu) to kfree_rcu()

The rcu callback tcf_common_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(tcf_common_free_rcu).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

authored by

Lai Jiangshan and committed by
Paul E. McKenney
f5c8593c 025cea99

+1 -6
+1 -6
net/sched/act_api.c
··· 26 26 #include <net/act_api.h> 27 27 #include <net/netlink.h> 28 28 29 - static void tcf_common_free_rcu(struct rcu_head *head) 30 - { 31 - kfree(container_of(head, struct tcf_common, tcfc_rcu)); 32 - } 33 - 34 29 void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo) 35 30 { 36 31 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); ··· 42 47 * gen_estimator est_timer() might access p->tcfc_lock 43 48 * or bstats, wait a RCU grace period before freeing p 44 49 */ 45 - call_rcu(&p->tcfc_rcu, tcf_common_free_rcu); 50 + kfree_rcu(p, tcfc_rcu); 46 51 return; 47 52 } 48 53 }