aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 08:47:49 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:53 -0400
commitc346dca10840a874240c78efe3f39acf4312a1f2 (patch)
treec04cff20124eba5cc337cc5ec260ad2513eeb065 /net/core/neighbour.c
parent7cbca67c073263c179f605bdbbdc565ab29d801d (diff)
[NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.
Introduce per-net_device inlines: dev_net(), dev_net_set(). Without CONFIG_NET_NS, no namespace other than &init_net exists. Let's explicitly define them to help compiler optimizations. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 23c0a10c0c37..c978bd1cd659 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -388,7 +388,7 @@ struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
388 hash_val = tbl->hash(pkey, NULL); 388 hash_val = tbl->hash(pkey, NULL);
389 for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { 389 for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) {
390 if (!memcmp(n->primary_key, pkey, key_len) && 390 if (!memcmp(n->primary_key, pkey, key_len) &&
391 (net == n->dev->nd_net)) { 391 dev_net(n->dev) == net) {
392 neigh_hold(n); 392 neigh_hold(n);
393 NEIGH_CACHE_STAT_INC(tbl, hits); 393 NEIGH_CACHE_STAT_INC(tbl, hits);
394 break; 394 break;
@@ -1298,7 +1298,7 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
1298 struct neigh_parms *p, *ref; 1298 struct neigh_parms *p, *ref;
1299 struct net *net; 1299 struct net *net;
1300 1300
1301 net = dev->nd_net; 1301 net = dev_net(dev);
1302 ref = lookup_neigh_params(tbl, net, 0); 1302 ref = lookup_neigh_params(tbl, net, 0);
1303 if (!ref) 1303 if (!ref)
1304 return NULL; 1304 return NULL;
@@ -2050,7 +2050,7 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
2050 s_idx = 0; 2050 s_idx = 0;
2051 for (n = tbl->hash_buckets[h], idx = 0; n; n = n->next) { 2051 for (n = tbl->hash_buckets[h], idx = 0; n; n = n->next) {
2052 int lidx; 2052 int lidx;
2053 if (n->dev->nd_net != net) 2053 if (dev_net(n->dev) != net)
2054 continue; 2054 continue;
2055 lidx = idx++; 2055 lidx = idx++;
2056 if (lidx < s_idx) 2056 if (lidx < s_idx)
@@ -2155,7 +2155,7 @@ static struct neighbour *neigh_get_first(struct seq_file *seq)
2155 n = tbl->hash_buckets[bucket]; 2155 n = tbl->hash_buckets[bucket];
2156 2156
2157 while (n) { 2157 while (n) {
2158 if (n->dev->nd_net != net) 2158 if (dev_net(n->dev) != net)
2159 goto next; 2159 goto next;
2160 if (state->neigh_sub_iter) { 2160 if (state->neigh_sub_iter) {
2161 loff_t fakep = 0; 2161 loff_t fakep = 0;
@@ -2198,7 +2198,7 @@ static struct neighbour *neigh_get_next(struct seq_file *seq,
2198 2198
2199 while (1) { 2199 while (1) {
2200 while (n) { 2200 while (n) {
2201 if (n->dev->nd_net != net) 2201 if (dev_net(n->dev) != net)
2202 goto next; 2202 goto next;
2203 if (state->neigh_sub_iter) { 2203 if (state->neigh_sub_iter) {
2204 void *v = state->neigh_sub_iter(state, n, pos); 2204 void *v = state->neigh_sub_iter(state, n, pos);
@@ -2482,7 +2482,7 @@ static inline size_t neigh_nlmsg_size(void)
2482 2482
2483static void __neigh_notify(struct neighbour *n, int type, int flags) 2483static void __neigh_notify(struct neighbour *n, int type, int flags)
2484{ 2484{
2485 struct net *net = n->dev->nd_net; 2485 struct net *net = dev_net(n->dev);
2486 struct sk_buff *skb; 2486 struct sk_buff *skb;
2487 int err = -ENOBUFS; 2487 int err = -ENOBUFS;
2488 2488