diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 08:47:49 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:53 -0400 |
commit | c346dca10840a874240c78efe3f39acf4312a1f2 (patch) | |
tree | c04cff20124eba5cc337cc5ec260ad2513eeb065 /drivers/net/wan | |
parent | 7cbca67c073263c179f605bdbbdc565ab29d801d (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 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/dlci.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/hdlc.c | 4 | ||||
-rw-r--r-- | drivers/net/wan/lapbether.c | 4 | ||||
-rw-r--r-- | drivers/net/wan/syncppp.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 96b232446c0b..b14242768fad 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -517,7 +517,7 @@ static int dlci_dev_event(struct notifier_block *unused, | |||
517 | { | 517 | { |
518 | struct net_device *dev = (struct net_device *) ptr; | 518 | struct net_device *dev = (struct net_device *) ptr; |
519 | 519 | ||
520 | if (dev->nd_net != &init_net) | 520 | if (dev_net(dev) != &init_net) |
521 | return NOTIFY_DONE; | 521 | return NOTIFY_DONE; |
522 | 522 | ||
523 | if (event == NETDEV_UNREGISTER) { | 523 | if (event == NETDEV_UNREGISTER) { |
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 39951d0c34d6..9a83c9d5b8cf 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
@@ -68,7 +68,7 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
68 | { | 68 | { |
69 | struct hdlc_device *hdlc = dev_to_hdlc(dev); | 69 | struct hdlc_device *hdlc = dev_to_hdlc(dev); |
70 | 70 | ||
71 | if (dev->nd_net != &init_net) { | 71 | if (dev_net(dev) != &init_net) { |
72 | kfree_skb(skb); | 72 | kfree_skb(skb); |
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
@@ -105,7 +105,7 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, | |||
105 | unsigned long flags; | 105 | unsigned long flags; |
106 | int on; | 106 | int on; |
107 | 107 | ||
108 | if (dev->nd_net != &init_net) | 108 | if (dev_net(dev) != &init_net) |
109 | return NOTIFY_DONE; | 109 | return NOTIFY_DONE; |
110 | 110 | ||
111 | if (dev->get_stats != hdlc_get_stats) | 111 | if (dev->get_stats != hdlc_get_stats) |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index fb37b8095231..629c909e05f9 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -91,7 +91,7 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
91 | int len, err; | 91 | int len, err; |
92 | struct lapbethdev *lapbeth; | 92 | struct lapbethdev *lapbeth; |
93 | 93 | ||
94 | if (dev->nd_net != &init_net) | 94 | if (dev_net(dev) != &init_net) |
95 | goto drop; | 95 | goto drop; |
96 | 96 | ||
97 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 97 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
@@ -393,7 +393,7 @@ static int lapbeth_device_event(struct notifier_block *this, | |||
393 | struct lapbethdev *lapbeth; | 393 | struct lapbethdev *lapbeth; |
394 | struct net_device *dev = ptr; | 394 | struct net_device *dev = ptr; |
395 | 395 | ||
396 | if (dev->nd_net != &init_net) | 396 | if (dev_net(dev) != &init_net) |
397 | return NOTIFY_DONE; | 397 | return NOTIFY_DONE; |
398 | 398 | ||
399 | if (!dev_is_ethdev(dev)) | 399 | if (!dev_is_ethdev(dev)) |
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c index 61e24b7a45a3..29b4b94e4947 100644 --- a/drivers/net/wan/syncppp.c +++ b/drivers/net/wan/syncppp.c | |||
@@ -1444,7 +1444,7 @@ static void sppp_print_bytes (u_char *p, u16 len) | |||
1444 | 1444 | ||
1445 | static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p, struct net_device *orig_dev) | 1445 | static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p, struct net_device *orig_dev) |
1446 | { | 1446 | { |
1447 | if (dev->nd_net != &init_net) { | 1447 | if (dev_net(dev) != &init_net) { |
1448 | kfree_skb(skb); | 1448 | kfree_skb(skb); |
1449 | return 0; | 1449 | return 0; |
1450 | } | 1450 | } |