diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-28 16:25:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-28 16:25:09 -0400 |
commit | 93adcc80f3288f1827baf6f821af818f6eeef7f9 (patch) | |
tree | d53faa5267421764ebe8f1d5e83e6eb5bb7ddea6 | |
parent | def8b4faff5ca349beafbbfeb2c51f3602a6ef3a (diff) |
net: don't use INIT_RCU_HEAD
call_rcu() will unconditionally rewrite RCU head anyway.
Applies to
struct neigh_parms
struct neigh_table
struct net
struct cipso_v4_doi
struct in_ifaddr
struct in_device
rt->u.dst
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/neighbour.c | 2 | ||||
-rw-r--r-- | net/core/net_namespace.c | 2 | ||||
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 1 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 9 | ||||
-rw-r--r-- | net/ipv4/route.c | 1 |
5 files changed, 1 insertions, 14 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 1dc728b38589..b337a937ea52 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1340,7 +1340,6 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev, | |||
1340 | if (p) { | 1340 | if (p) { |
1341 | p->tbl = tbl; | 1341 | p->tbl = tbl; |
1342 | atomic_set(&p->refcnt, 1); | 1342 | atomic_set(&p->refcnt, 1); |
1343 | INIT_RCU_HEAD(&p->rcu_head); | ||
1344 | p->reachable_time = | 1343 | p->reachable_time = |
1345 | neigh_rand_reach_time(p->base_reachable_time); | 1344 | neigh_rand_reach_time(p->base_reachable_time); |
1346 | 1345 | ||
@@ -1412,7 +1411,6 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) | |||
1412 | tbl->parms.net = &init_net; | 1411 | tbl->parms.net = &init_net; |
1413 | #endif | 1412 | #endif |
1414 | atomic_set(&tbl->parms.refcnt, 1); | 1413 | atomic_set(&tbl->parms.refcnt, 1); |
1415 | INIT_RCU_HEAD(&tbl->parms.rcu_head); | ||
1416 | tbl->parms.reachable_time = | 1414 | tbl->parms.reachable_time = |
1417 | neigh_rand_reach_time(tbl->parms.base_reachable_time); | 1415 | neigh_rand_reach_time(tbl->parms.base_reachable_time); |
1418 | 1416 | ||
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index f1d07b5c1e17..861b4cbf40db 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -47,7 +47,6 @@ static __net_init int setup_net(struct net *net) | |||
47 | goto out; | 47 | goto out; |
48 | 48 | ||
49 | ng->len = INITIAL_NET_GEN_PTRS; | 49 | ng->len = INITIAL_NET_GEN_PTRS; |
50 | INIT_RCU_HEAD(&ng->rcu); | ||
51 | rcu_assign_pointer(net->gen, ng); | 50 | rcu_assign_pointer(net->gen, ng); |
52 | 51 | ||
53 | error = 0; | 52 | error = 0; |
@@ -446,7 +445,6 @@ int net_assign_generic(struct net *net, int id, void *data) | |||
446 | */ | 445 | */ |
447 | 446 | ||
448 | ng->len = id; | 447 | ng->len = id; |
449 | INIT_RCU_HEAD(&ng->rcu); | ||
450 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len); | 448 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len); |
451 | 449 | ||
452 | rcu_assign_pointer(net->gen, ng); | 450 | rcu_assign_pointer(net->gen, ng); |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 490e035c6d90..4bcec7f77251 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -490,7 +490,6 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def) | |||
490 | } | 490 | } |
491 | 491 | ||
492 | atomic_set(&doi_def->refcount, 1); | 492 | atomic_set(&doi_def->refcount, 1); |
493 | INIT_RCU_HEAD(&doi_def->rcu); | ||
494 | 493 | ||
495 | spin_lock(&cipso_v4_doi_list_lock); | 494 | spin_lock(&cipso_v4_doi_list_lock); |
496 | if (cipso_v4_doi_search(doi_def->doi) != NULL) | 495 | if (cipso_v4_doi_search(doi_def->doi) != NULL) |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 56fce3ab6c55..0bff576d2918 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -112,13 +112,7 @@ static inline void devinet_sysctl_unregister(struct in_device *idev) | |||
112 | 112 | ||
113 | static struct in_ifaddr *inet_alloc_ifa(void) | 113 | static struct in_ifaddr *inet_alloc_ifa(void) |
114 | { | 114 | { |
115 | struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); | 115 | return kzalloc(sizeof(struct in_ifaddr), GFP_KERNEL); |
116 | |||
117 | if (ifa) { | ||
118 | INIT_RCU_HEAD(&ifa->rcu_head); | ||
119 | } | ||
120 | |||
121 | return ifa; | ||
122 | } | 116 | } |
123 | 117 | ||
124 | static void inet_rcu_free_ifa(struct rcu_head *head) | 118 | static void inet_rcu_free_ifa(struct rcu_head *head) |
@@ -161,7 +155,6 @@ static struct in_device *inetdev_init(struct net_device *dev) | |||
161 | in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); | 155 | in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); |
162 | if (!in_dev) | 156 | if (!in_dev) |
163 | goto out; | 157 | goto out; |
164 | INIT_RCU_HEAD(&in_dev->rcu_head); | ||
165 | memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, | 158 | memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, |
166 | sizeof(in_dev->cnf)); | 159 | sizeof(in_dev->cnf)); |
167 | in_dev->cnf.sysctl = NULL; | 160 | in_dev->cnf.sysctl = NULL; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index ffb2c5705432..e59b4dcf6778 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1386,7 +1386,6 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1386 | 1386 | ||
1387 | /* Copy all the information. */ | 1387 | /* Copy all the information. */ |
1388 | *rt = *rth; | 1388 | *rt = *rth; |
1389 | INIT_RCU_HEAD(&rt->u.dst.rcu_head); | ||
1390 | rt->u.dst.__use = 1; | 1389 | rt->u.dst.__use = 1; |
1391 | atomic_set(&rt->u.dst.__refcnt, 1); | 1390 | atomic_set(&rt->u.dst.__refcnt, 1); |
1392 | rt->u.dst.child = NULL; | 1391 | rt->u.dst.child = NULL; |