[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

@@ -351,7 +351,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
struct sock *sk;
struct sk_buff *skb;
sk = icmp_sk(rt->u.dst.dev->nd_net);
sk = icmp_sk(dev_net(rt->u.dst.dev));
if (ip_append_data(sk, icmp_glue_bits, icmp_param,
icmp_param->data_len+icmp_param->head_len,
icmp_param->head_len,
@@ -382,7 +382,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
{
struct ipcm_cookie ipc;
struct rtable *rt = skb->rtable;
struct net *net = rt->u.dst.dev->nd_net;
struct net *net = dev_net(rt->u.dst.dev);
struct sock *sk = icmp_sk(net);
struct inet_sock *inet = inet_sk(sk);
__be32 daddr;
@@ -447,7 +447,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
if (!rt)
goto out;
net = rt->u.dst.dev->nd_net;
net = dev_net(rt->u.dst.dev);
sk = icmp_sk(net);
/*
@@ -677,7 +677,7 @@ static void icmp_unreach(struct sk_buff *skb)
u32 info = 0;
struct net *net;
net = skb->dst->dev->nd_net;
net = dev_net(skb->dst->dev);
/*
* Incomplete header ?