Commit dcdc7a59 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

vxlan: 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7fb06a1
...@@ -542,12 +542,6 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan, ...@@ -542,12 +542,6 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
return 0; return 0;
} }
static void vxlan_fdb_free_rdst(struct rcu_head *head)
{
struct vxlan_rdst *rd = container_of(head, struct vxlan_rdst, rcu);
kfree(rd);
}
static void vxlan_fdb_free(struct rcu_head *head) static void vxlan_fdb_free(struct rcu_head *head)
{ {
struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu); struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu);
...@@ -687,7 +681,7 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], ...@@ -687,7 +681,7 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
*/ */
if (rd && !list_is_singular(&f->remotes)) { if (rd && !list_is_singular(&f->remotes)) {
list_del_rcu(&rd->list); list_del_rcu(&rd->list);
call_rcu(&rd->rcu, vxlan_fdb_free_rdst); kfree_rcu(rd, rcu);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment