[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd89R4FkKq1tCyuL9WWRXgsCb7ZpGGsw3yiPn1Ht5X61Vw@mail.gmail.com>
Date: Wed, 17 Jul 2013 13:29:58 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: davem@...emloft.net, stephen@...workplumber.org,
pshelar@...ira.com, mike.rapoport@...ellosystems.com,
amwang@...hat.com
Cc: yongjun_wei@...ndmicro.com.cn, netdev@...r.kernel.org
Subject: [PATCH -next] vxlan: using kfree_rcu() to simplify the code
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
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@...ndmicro.com.cn>
---
drivers/net/vxlan.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 227b54a..d6fc046 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -498,12 +498,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);
@@ -643,7 +637,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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists