diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-05 04:37:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:56:26 -0500 |
commit | 33eb9cfc700ae9ce621d47d6ca6d6b4ad7cd97f3 (patch) | |
tree | d5e3c0e9644249fa327c613571613c43ec474c6b /net/core | |
parent | 7e2e109cef0d59abcb9aca8b82993e304ed8970c (diff) |
[NET]: Isolate the net/core/ sysctl table
Using ctl paths we can put all the stuff, related to net/core/
sysctl table, into one file and remove all the references on it.
As a good side effect this hides the "core_table" name from
the global scope :)
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sysctl_net_core.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 277c8faaf732..e322713e590a 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -10,10 +10,11 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
12 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
13 | #include <linux/init.h> | ||
13 | #include <net/sock.h> | 14 | #include <net/sock.h> |
14 | #include <net/xfrm.h> | 15 | #include <net/xfrm.h> |
15 | 16 | ||
16 | ctl_table core_table[] = { | 17 | static struct ctl_table net_core_table[] = { |
17 | #ifdef CONFIG_NET | 18 | #ifdef CONFIG_NET |
18 | { | 19 | { |
19 | .ctl_name = NET_CORE_WMEM_MAX, | 20 | .ctl_name = NET_CORE_WMEM_MAX, |
@@ -149,3 +150,19 @@ ctl_table core_table[] = { | |||
149 | }, | 150 | }, |
150 | { .ctl_name = 0 } | 151 | { .ctl_name = 0 } |
151 | }; | 152 | }; |
153 | |||
154 | static __initdata struct ctl_path net_core_path[] = { | ||
155 | { .procname = "net", .ctl_name = CTL_NET, }, | ||
156 | { .procname = "core", .ctl_name = NET_CORE, }, | ||
157 | { }, | ||
158 | }; | ||
159 | |||
160 | static __init int sysctl_core_init(void) | ||
161 | { | ||
162 | struct ctl_table_header *hdr; | ||
163 | |||
164 | hdr = register_sysctl_paths(net_core_path, net_core_table); | ||
165 | return hdr == NULL ? -ENOMEM : 0; | ||
166 | } | ||
167 | |||
168 | __initcall(sysctl_core_init); | ||