aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-03-31 22:41:14 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-31 22:41:14 -0400
commit8efa6e93cb2666dceafc4844057fdcb9aa324fb7 (patch)
tree3fbf8da25edf1b942411d89896400effd5a83419 /net
parent3edf8fa5ccf10688a9280b5cbca8ed3947c42866 (diff)
[NETNS]: Introduce a netns_core structure.
There's already some stuff on the struct net, that should better be folded into netns_core structure. I'm making the per-proto inuse counter be per-net also, which is also a candidate for this, so introduce this structure and populate it a bit. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/sysctl_net_core.c12
-rw-r--r--net/socket.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 130338f83ae5..5fc801057244 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -127,7 +127,7 @@ static struct ctl_table net_core_table[] = {
127 { 127 {
128 .ctl_name = NET_CORE_SOMAXCONN, 128 .ctl_name = NET_CORE_SOMAXCONN,
129 .procname = "somaxconn", 129 .procname = "somaxconn",
130 .data = &init_net.sysctl_somaxconn, 130 .data = &init_net.core.sysctl_somaxconn,
131 .maxlen = sizeof(int), 131 .maxlen = sizeof(int),
132 .mode = 0644, 132 .mode = 0644,
133 .proc_handler = &proc_dointvec 133 .proc_handler = &proc_dointvec
@@ -161,7 +161,7 @@ static __net_init int sysctl_core_net_init(struct net *net)
161{ 161{
162 struct ctl_table *tbl, *tmp; 162 struct ctl_table *tbl, *tmp;
163 163
164 net->sysctl_somaxconn = SOMAXCONN; 164 net->core.sysctl_somaxconn = SOMAXCONN;
165 165
166 tbl = net_core_table; 166 tbl = net_core_table;
167 if (net != &init_net) { 167 if (net != &init_net) {
@@ -178,9 +178,9 @@ static __net_init int sysctl_core_net_init(struct net *net)
178 } 178 }
179 } 179 }
180 180
181 net->sysctl_core_hdr = register_net_sysctl_table(net, 181 net->core.sysctl_hdr = register_net_sysctl_table(net,
182 net_core_path, tbl); 182 net_core_path, tbl);
183 if (net->sysctl_core_hdr == NULL) 183 if (net->core.sysctl_hdr == NULL)
184 goto err_reg; 184 goto err_reg;
185 185
186 return 0; 186 return 0;
@@ -196,8 +196,8 @@ static __net_exit void sysctl_core_net_exit(struct net *net)
196{ 196{
197 struct ctl_table *tbl; 197 struct ctl_table *tbl;
198 198
199 tbl = net->sysctl_core_hdr->ctl_table_arg; 199 tbl = net->core.sysctl_hdr->ctl_table_arg;
200 unregister_net_sysctl_table(net->sysctl_core_hdr); 200 unregister_net_sysctl_table(net->core.sysctl_hdr);
201 BUG_ON(tbl == net_core_table); 201 BUG_ON(tbl == net_core_table);
202 kfree(tbl); 202 kfree(tbl);
203} 203}
diff --git a/net/socket.c b/net/socket.c
index 79e5382fd110..9b5c917f8a6b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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_net(sock->sk)->sysctl_somaxconn; 1378 somaxconn = sock_net(sock->sk)->core.sysctl_somaxconn;
1379 if ((unsigned)backlog > somaxconn) 1379 if ((unsigned)backlog > somaxconn)
1380 backlog = somaxconn; 1380 backlog = somaxconn;
1381 1381