aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-09 03:32:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:09 -0500
commitc6995bdff0fc9f97621922a7f857fa640537a7e2 (patch)
tree0cf803381e0eff2144e108e3c418ad2d54fa2a16 /net
parent3151a9ab04714d0323efbe3c6c12bc5b2b1f058d (diff)
[AX25]: Switch to using ctl_paths.
This one is almost the same as the hunks in the first patch, but ax25 tables are created dynamically. So this patch differs a bit to handle this case. 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/ax25/sysctl_net_ax25.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 443a83676638..f597987b2424 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -31,25 +31,11 @@ static struct ctl_table_header *ax25_table_header;
31static ctl_table *ax25_table; 31static ctl_table *ax25_table;
32static int ax25_table_size; 32static int ax25_table_size;
33 33
34static ctl_table ax25_dir_table[] = { 34static struct ctl_path ax25_path[] = {
35 { 35 { .procname = "net", .ctl_name = CTL_NET, },
36 .ctl_name = NET_AX25, 36 { .procname = "ax25", .ctl_name = NET_AX25, },
37 .procname = "ax25", 37 { }
38 .mode = 0555,
39 },
40 { .ctl_name = 0 }
41};
42
43static ctl_table ax25_root_table[] = {
44 {
45 .ctl_name = CTL_NET,
46 .procname = "net",
47 .mode = 0555,
48 .child = ax25_dir_table
49 },
50 { .ctl_name = 0 }
51}; 38};
52
53static const ctl_table ax25_param_table[] = { 39static const ctl_table ax25_param_table[] = {
54 { 40 {
55 .ctl_name = NET_AX25_IP_DEFAULT_MODE, 41 .ctl_name = NET_AX25_IP_DEFAULT_MODE,
@@ -243,9 +229,7 @@ void ax25_register_sysctl(void)
243 } 229 }
244 spin_unlock_bh(&ax25_dev_lock); 230 spin_unlock_bh(&ax25_dev_lock);
245 231
246 ax25_dir_table[0].child = ax25_table; 232 ax25_table_header = register_sysctl_paths(ax25_path, ax25_table);
247
248 ax25_table_header = register_sysctl_table(ax25_root_table);
249} 233}
250 234
251void ax25_unregister_sysctl(void) 235void ax25_unregister_sysctl(void)
@@ -253,7 +237,6 @@ void ax25_unregister_sysctl(void)
253 ctl_table *p; 237 ctl_table *p;
254 unregister_sysctl_table(ax25_table_header); 238 unregister_sysctl_table(ax25_table_header);
255 239
256 ax25_dir_table[0].child = NULL;
257 for (p = ax25_table; p->ctl_name; p++) 240 for (p = ax25_table; p->ctl_name; p++)
258 kfree(p->child); 241 kfree(p->child);
259 kfree(ax25_table); 242 kfree(ax25_table);