[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>
This commit is contained in:
YOSHIFUJI Hideaki
2008-03-25 21:47:49 +09:00
parent 7cbca67c07
commit c346dca108
87 changed files with 251 additions and 228 deletions

View File

@@ -972,7 +972,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
goto err_free;
}
dev->nd_net = net;
dev_net_set(dev, net);
dev->rtnl_link_ops = ops;
if (tb[IFLA_MTU])
@@ -1198,7 +1198,7 @@ static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
{
struct net *net = dev->nd_net;
struct net *net = dev_net(dev);
struct sk_buff *skb;
int err = -ENOBUFS;