diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2011-03-18 00:06:32 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-08 01:51:07 -0400 |
commit | 04d4dfed8e64f65d672502a614a4bb9093d1affd (patch) | |
tree | 1b1bd07034d293daa6a4b8f0ddf8d7c0ea81a65c | |
parent | 6b2622328110b9c1094a4f644a6cdc9b6d5450ac (diff) |
net,rcu: convert call_rcu(net_generic_release) to kfree_rcu()
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>
-rw-r--r-- | net/core/net_namespace.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 3f860261c5ee..297bb9272240 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -27,14 +27,6 @@ EXPORT_SYMBOL(init_net); | |||
27 | 27 | ||
28 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ | 28 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ |
29 | 29 | ||
30 | static void net_generic_release(struct rcu_head *rcu) | ||
31 | { | ||
32 | struct net_generic *ng; | ||
33 | |||
34 | ng = container_of(rcu, struct net_generic, rcu); | ||
35 | kfree(ng); | ||
36 | } | ||
37 | |||
38 | static int net_assign_generic(struct net *net, int id, void *data) | 30 | static int net_assign_generic(struct net *net, int id, void *data) |
39 | { | 31 | { |
40 | struct net_generic *ng, *old_ng; | 32 | struct net_generic *ng, *old_ng; |
@@ -68,7 +60,7 @@ static int net_assign_generic(struct net *net, int id, void *data) | |||
68 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); | 60 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); |
69 | 61 | ||
70 | rcu_assign_pointer(net->gen, ng); | 62 | rcu_assign_pointer(net->gen, ng); |
71 | call_rcu(&old_ng->rcu, net_generic_release); | 63 | kfree_rcu(old_ng, rcu); |
72 | assign: | 64 | assign: |
73 | ng->ptr[id - 1] = data; | 65 | ng->ptr[id - 1] = data; |
74 | return 0; | 66 | return 0; |