Skip to content

Commit

Permalink
vxlan: using kfree_rcu() to simplify the code
Browse files Browse the repository at this point in the history
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 <yongjun_wei@trendmicro.com.cn>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Aug 20, 2013
1 parent e7fb06a commit dcdc7a5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,6 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
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)
{
struct vxlan_fdb *f = container_of(head, struct vxlan_fdb, rcu);
Expand Down Expand Up @@ -687,7 +681,7 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[],
*/
if (rd && !list_is_singular(&f->remotes)) {
list_del_rcu(&rd->list);
call_rcu(&rd->rcu, vxlan_fdb_free_rdst);
kfree_rcu(rd, rcu);
goto out;
}

Expand Down

0 comments on commit dcdc7a5

Please sign in to comment.