diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-04-19 09:35:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-20 21:22:29 -0400 |
commit | 64fb3010400f6051261be9c5c74f29de416dad8f (patch) | |
tree | 6c3547de66fa11943bdadcd285114df5ace28d75 /net/llc | |
parent | 0ca7a4c87d27dd2fde0783dec94a821d6d035696 (diff) |
net llc: Don't use sysctl tables with .child entries.
The sysctl core no longer natively understands sysctl tables with .child
entries.
Kill the intermediate tables and use register_net_sysctl directly to
remove the need for compatibility code.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc')
-rw-r--r-- | net/llc/sysctl_net_llc.c | 51 |
1 files changed, 16 insertions, 35 deletions
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c index 9a6a65f2104b..d75306b9c2f3 100644 --- a/net/llc/sysctl_net_llc.c +++ b/net/llc/sysctl_net_llc.c | |||
@@ -57,48 +57,29 @@ static struct ctl_table llc_station_table[] = { | |||
57 | { }, | 57 | { }, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | static struct ctl_table llc2_dir_timeout_table[] = { | 60 | static struct ctl_table_header *llc2_timeout_header; |
61 | { | 61 | static struct ctl_table_header *llc_station_header; |
62 | .procname = "timeout", | ||
63 | .mode = 0555, | ||
64 | .child = llc2_timeout_table, | ||
65 | }, | ||
66 | { }, | ||
67 | }; | ||
68 | |||
69 | static struct ctl_table llc_table[] = { | ||
70 | { | ||
71 | .procname = "llc2", | ||
72 | .mode = 0555, | ||
73 | .child = llc2_dir_timeout_table, | ||
74 | }, | ||
75 | { | ||
76 | .procname = "station", | ||
77 | .mode = 0555, | ||
78 | .child = llc_station_table, | ||
79 | }, | ||
80 | { }, | ||
81 | }; | ||
82 | |||
83 | static struct ctl_path llc_path[] = { | ||
84 | { .procname = "net", }, | ||
85 | { .procname = "llc", }, | ||
86 | { } | ||
87 | }; | ||
88 | |||
89 | static struct ctl_table_header *llc_table_header; | ||
90 | 62 | ||
91 | int __init llc_sysctl_init(void) | 63 | int __init llc_sysctl_init(void) |
92 | { | 64 | { |
93 | llc_table_header = register_net_sysctl_table(&init_net, llc_path, llc_table); | 65 | llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table); |
66 | llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table); | ||
94 | 67 | ||
95 | return llc_table_header ? 0 : -ENOMEM; | 68 | if (!llc2_timeout_header || !llc_station_header) { |
69 | llc_sysctl_exit(); | ||
70 | return -ENOMEM; | ||
71 | } | ||
72 | return 0; | ||
96 | } | 73 | } |
97 | 74 | ||
98 | void llc_sysctl_exit(void) | 75 | void llc_sysctl_exit(void) |
99 | { | 76 | { |
100 | if (llc_table_header) { | 77 | if (llc2_timeout_header) { |
101 | unregister_net_sysctl_table(llc_table_header); | 78 | unregister_net_sysctl_table(llc2_timeout_header); |
102 | llc_table_header = NULL; | 79 | llc2_timeout_header = NULL; |
80 | } | ||
81 | if (llc_station_header) { | ||
82 | unregister_net_sysctl_table(llc_station_header); | ||
83 | llc_station_header = NULL; | ||
103 | } | 84 | } |
104 | } | 85 | } |