aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 13:26:21 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:55 -0400
commit3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch)
tree09edb35f32ebcfb1b4dad904425128a110ef16ee /net/socket.c
parentc346dca10840a874240c78efe3f39acf4312a1f2 (diff)
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set() and per-inet_timewait_sock inlines: twsk_net(), twsk_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/socket.c')
-rw-r--r--net/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 9d3fbfbc8535..79e5382fd110 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -857,7 +857,7 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
857 857
858 sock = file->private_data; 858 sock = file->private_data;
859 sk = sock->sk; 859 sk = sock->sk;
860 net = sk->sk_net; 860 net = sock_net(sk);
861 if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { 861 if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
862 err = dev_ioctl(net, cmd, argp); 862 err = dev_ioctl(net, cmd, argp);
863 } else 863 } else
@@ -1375,7 +1375,7 @@ asmlinkage long sys_listen(int fd, int backlog)
1375 1375
1376 sock = sockfd_lookup_light(fd, &err, &fput_needed); 1376 sock = sockfd_lookup_light(fd, &err, &fput_needed);
1377 if (sock) { 1377 if (sock) {
1378 somaxconn = sock->sk->sk_net->sysctl_somaxconn; 1378 somaxconn = sock_net(sock->sk)->sysctl_somaxconn;
1379 if ((unsigned)backlog > somaxconn) 1379 if ((unsigned)backlog > somaxconn)
1380 backlog = somaxconn; 1380 backlog = somaxconn;
1381 1381