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 /net/ipv4/devinet.c | |
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 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 4a10dbbbe0a1..823c724a8593 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -165,7 +165,7 @@ static struct in_device *inetdev_init(struct net_device *dev) | |||
165 | if (!in_dev) | 165 | if (!in_dev) |
166 | goto out; | 166 | goto out; |
167 | INIT_RCU_HEAD(&in_dev->rcu_head); | 167 | INIT_RCU_HEAD(&in_dev->rcu_head); |
168 | memcpy(&in_dev->cnf, dev->nd_net->ipv4.devconf_dflt, | 168 | memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, |
169 | sizeof(in_dev->cnf)); | 169 | sizeof(in_dev->cnf)); |
170 | in_dev->cnf.sysctl = NULL; | 170 | in_dev->cnf.sysctl = NULL; |
171 | in_dev->dev = dev; | 171 | in_dev->dev = dev; |
@@ -872,7 +872,7 @@ __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope) | |||
872 | { | 872 | { |
873 | __be32 addr = 0; | 873 | __be32 addr = 0; |
874 | struct in_device *in_dev; | 874 | struct in_device *in_dev; |
875 | struct net *net = dev->nd_net; | 875 | struct net *net = dev_net(dev); |
876 | 876 | ||
877 | rcu_read_lock(); | 877 | rcu_read_lock(); |
878 | in_dev = __in_dev_get_rcu(dev); | 878 | in_dev = __in_dev_get_rcu(dev); |
@@ -974,7 +974,7 @@ __be32 inet_confirm_addr(struct in_device *in_dev, | |||
974 | if (scope != RT_SCOPE_LINK) | 974 | if (scope != RT_SCOPE_LINK) |
975 | return confirm_addr_indev(in_dev, dst, local, scope); | 975 | return confirm_addr_indev(in_dev, dst, local, scope); |
976 | 976 | ||
977 | net = in_dev->dev->nd_net; | 977 | net = dev_net(in_dev->dev); |
978 | read_lock(&dev_base_lock); | 978 | read_lock(&dev_base_lock); |
979 | rcu_read_lock(); | 979 | rcu_read_lock(); |
980 | for_each_netdev(net, dev) { | 980 | for_each_netdev(net, dev) { |
@@ -1203,7 +1203,7 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa, struct nlmsghdr *nlh, | |||
1203 | int err = -ENOBUFS; | 1203 | int err = -ENOBUFS; |
1204 | struct net *net; | 1204 | struct net *net; |
1205 | 1205 | ||
1206 | net = ifa->ifa_dev->dev->nd_net; | 1206 | net = dev_net(ifa->ifa_dev->dev); |
1207 | skb = nlmsg_new(inet_nlmsg_size(), GFP_KERNEL); | 1207 | skb = nlmsg_new(inet_nlmsg_size(), GFP_KERNEL); |
1208 | if (skb == NULL) | 1208 | if (skb == NULL) |
1209 | goto errout; | 1209 | goto errout; |
@@ -1517,7 +1517,7 @@ static void devinet_sysctl_register(struct in_device *idev) | |||
1517 | { | 1517 | { |
1518 | neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, | 1518 | neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, |
1519 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); | 1519 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); |
1520 | __devinet_sysctl_register(idev->dev->nd_net, idev->dev->name, | 1520 | __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, |
1521 | idev->dev->ifindex, &idev->cnf); | 1521 | idev->dev->ifindex, &idev->cnf); |
1522 | } | 1522 | } |
1523 | 1523 | ||