diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-11-12 03:54:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-12 03:54:54 -0500 |
commit | e42ea986e4a4cab4209d982feffcaf50f21e80e3 (patch) | |
tree | da674327f247cf325320caef87df6af5a0af8fd6 /net | |
parent | 7a9546ee354ec6f23af403992b8c07baa50a23d2 (diff) |
net: Cleanup of neighbour code
Using read_pnet() and write_pnet() in neighbour code ease the reading
of code.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/neighbour.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 500c2430007c..cca6a55909eb 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -531,9 +531,7 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, | |||
531 | if (!n) | 531 | if (!n) |
532 | goto out; | 532 | goto out; |
533 | 533 | ||
534 | #ifdef CONFIG_NET_NS | 534 | write_pnet(&n->net, hold_net(net)); |
535 | n->net = hold_net(net); | ||
536 | #endif | ||
537 | memcpy(n->key, pkey, key_len); | 535 | memcpy(n->key, pkey, key_len); |
538 | n->dev = dev; | 536 | n->dev = dev; |
539 | if (dev) | 537 | if (dev) |
@@ -1350,9 +1348,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev, | |||
1350 | 1348 | ||
1351 | dev_hold(dev); | 1349 | dev_hold(dev); |
1352 | p->dev = dev; | 1350 | p->dev = dev; |
1353 | #ifdef CONFIG_NET_NS | 1351 | write_pnet(&p->net, hold_net(net)); |
1354 | p->net = hold_net(net); | ||
1355 | #endif | ||
1356 | p->sysctl_table = NULL; | 1352 | p->sysctl_table = NULL; |
1357 | write_lock_bh(&tbl->lock); | 1353 | write_lock_bh(&tbl->lock); |
1358 | p->next = tbl->parms.next; | 1354 | p->next = tbl->parms.next; |
@@ -1407,9 +1403,7 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) | |||
1407 | unsigned long now = jiffies; | 1403 | unsigned long now = jiffies; |
1408 | unsigned long phsize; | 1404 | unsigned long phsize; |
1409 | 1405 | ||
1410 | #ifdef CONFIG_NET_NS | 1406 | write_pnet(&tbl->parms.net, &init_net); |
1411 | tbl->parms.net = &init_net; | ||
1412 | #endif | ||
1413 | atomic_set(&tbl->parms.refcnt, 1); | 1407 | atomic_set(&tbl->parms.refcnt, 1); |
1414 | tbl->parms.reachable_time = | 1408 | tbl->parms.reachable_time = |
1415 | neigh_rand_reach_time(tbl->parms.base_reachable_time); | 1409 | neigh_rand_reach_time(tbl->parms.base_reachable_time); |