net: sched: using kfree_rcu() to simplify the code
The callback function of call_rcu() just calls a kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
780feae7eb
commit
6e07902f56
@@ -526,11 +526,6 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt,
|
|||||||
return stab;
|
return stab;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stab_kfree_rcu(struct rcu_head *head)
|
|
||||||
{
|
|
||||||
kfree(container_of(head, struct qdisc_size_table, rcu));
|
|
||||||
}
|
|
||||||
|
|
||||||
void qdisc_put_stab(struct qdisc_size_table *tab)
|
void qdisc_put_stab(struct qdisc_size_table *tab)
|
||||||
{
|
{
|
||||||
if (!tab)
|
if (!tab)
|
||||||
@@ -538,7 +533,7 @@ void qdisc_put_stab(struct qdisc_size_table *tab)
|
|||||||
|
|
||||||
if (--tab->refcnt == 0) {
|
if (--tab->refcnt == 0) {
|
||||||
list_del(&tab->list);
|
list_del(&tab->list);
|
||||||
call_rcu(&tab->rcu, stab_kfree_rcu);
|
kfree_rcu(tab, rcu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(qdisc_put_stab);
|
EXPORT_SYMBOL(qdisc_put_stab);
|
||||||
|
|||||||
Reference in New Issue
Block a user