net,rcu: convert call_rcu(net_generic_release) to kfree_rcu()
authorLai Jiangshan <laijs@cn.fujitsu.com>
Fri, 18 Mar 2011 04:06:32 +0000 (12:06 +0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 8 May 2011 05:51:07 +0000 (22:51 -0700)
The rcu callback net_generic_release() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(net_generic_release).

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>
net/core/net_namespace.c

index 3f860261c5eea2be402ed0556a3a8b3f6fd7fc9b..297bb92722407f573bd8446154f773e74166bcc4 100644 (file)
@@ -27,14 +27,6 @@ EXPORT_SYMBOL(init_net);
 
 #define INITIAL_NET_GEN_PTRS   13 /* +1 for len +2 for rcu_head */
 
-static void net_generic_release(struct rcu_head *rcu)
-{
-       struct net_generic *ng;
-
-       ng = container_of(rcu, struct net_generic, rcu);
-       kfree(ng);
-}
-
 static int net_assign_generic(struct net *net, int id, void *data)
 {
        struct net_generic *ng, *old_ng;
@@ -68,7 +60,7 @@ static int net_assign_generic(struct net *net, int id, void *data)
        memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*));
 
        rcu_assign_pointer(net->gen, ng);
-       call_rcu(&old_ng->rcu, net_generic_release);
+       kfree_rcu(old_ng, rcu);
 assign:
        ng->ptr[id - 1] = data;
        return 0;