diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-12-01 07:45:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:55:22 -0500 |
commit | 1d430b913c2e6293a80a4a422406bc9489a476ad (patch) | |
tree | 1b7a34062422a8d23fbb57a8ea935ec3ac15a8ae /net/unix/sysctl_net_unix.c | |
parent | d392e49756a99ba51577d265d6db83e3f01c6ac8 (diff) |
[UNIX]: Use ctl paths to register unix ctl tables
Unlike previous ones, this patch is useful by its own,
as it decreases the vmlinux size :)
But it will be used later, when the per-namespace sysctl
is added.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
-rw-r--r-- | net/unix/sysctl_net_unix.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index c46cec04d23f..43dd356730fd 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c | |||
@@ -26,31 +26,17 @@ static ctl_table unix_table[] = { | |||
26 | { .ctl_name = 0 } | 26 | { .ctl_name = 0 } |
27 | }; | 27 | }; |
28 | 28 | ||
29 | static ctl_table unix_net_table[] = { | 29 | static struct ctl_path unix_path[] = { |
30 | { | 30 | { .procname = "net", .ctl_name = CTL_NET, }, |
31 | .ctl_name = NET_UNIX, | 31 | { .procname = "unix", .ctl_name = NET_UNIX, }, |
32 | .procname = "unix", | 32 | { }, |
33 | .mode = 0555, | ||
34 | .child = unix_table | ||
35 | }, | ||
36 | { .ctl_name = 0 } | ||
37 | }; | ||
38 | |||
39 | static ctl_table unix_root_table[] = { | ||
40 | { | ||
41 | .ctl_name = CTL_NET, | ||
42 | .procname = "net", | ||
43 | .mode = 0555, | ||
44 | .child = unix_net_table | ||
45 | }, | ||
46 | { .ctl_name = 0 } | ||
47 | }; | 33 | }; |
48 | 34 | ||
49 | static struct ctl_table_header * unix_sysctl_header; | 35 | static struct ctl_table_header * unix_sysctl_header; |
50 | 36 | ||
51 | int unix_sysctl_register(struct net *net) | 37 | int unix_sysctl_register(struct net *net) |
52 | { | 38 | { |
53 | unix_sysctl_header = register_sysctl_table(unix_root_table); | 39 | unix_sysctl_header = register_sysctl_paths(unix_path, unix_table); |
54 | return unix_sysctl_header == NULL ? -ENOMEM : 0; | 40 | return unix_sysctl_header == NULL ? -ENOMEM : 0; |
55 | } | 41 | } |
56 | 42 | ||