aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-09 03:30:05 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:07 -0500
commitb5ccd792fa413f9336273cb8fa3b9dd3a7ec1735 (patch)
tree64b23972fdf667baa74a0895bf403b22eb7de86c
parentcb7928a528264a69b29b6001b490b64607ed0557 (diff)
[NET]: Simple ctl_table to ctl_path conversions.
This patch includes many places, that only required replacing the ctl_table-s with appropriate ctl_paths and call register_sysctl_paths(). Nothing special was done with them. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/appletalk/sysctl_net_atalk.c24
-rw-r--r--net/bridge/br_netfilter.c24
-rw-r--r--net/dccp/sysctl.c36
-rw-r--r--net/ipx/sysctl_net_ipx.c24
-rw-r--r--net/irda/irsysctl.c28
-rw-r--r--net/llc/sysctl_net_llc.c24
-rw-r--r--net/netrom/sysctl_net_netrom.c24
-rw-r--r--net/rose/sysctl_net_rose.c24
-rw-r--r--net/sctp/sysctl.c24
-rw-r--r--net/x25/sysctl_net_x25.c24
10 files changed, 52 insertions, 204 deletions
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
index 7df1778e221a..621805dfa2f4 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/net/appletalk/sysctl_net_atalk.c
@@ -49,31 +49,17 @@ static struct ctl_table atalk_table[] = {
49 { 0 }, 49 { 0 },
50}; 50};
51 51
52static struct ctl_table atalk_dir_table[] = { 52static struct ctl_path atalk_path[] = {
53 { 53 { .procname = "net", .ctl_name = CTL_NET, },
54 .ctl_name = NET_ATALK, 54 { .procname = "appletalk", .ctl_name = NET_ATALK, },
55 .procname = "appletalk", 55 { }
56 .mode = 0555,
57 .child = atalk_table,
58 },
59 { 0 },
60};
61
62static struct ctl_table atalk_root_table[] = {
63 {
64 .ctl_name = CTL_NET,
65 .procname = "net",
66 .mode = 0555,
67 .child = atalk_dir_table,
68 },
69 { 0 },
70}; 56};
71 57
72static struct ctl_table_header *atalk_table_header; 58static struct ctl_table_header *atalk_table_header;
73 59
74void atalk_register_sysctl(void) 60void atalk_register_sysctl(void)
75{ 61{
76 atalk_table_header = register_sysctl_table(atalk_root_table); 62 atalk_table_header = register_sysctl_paths(atalk_path, atalk_table);
77} 63}
78 64
79void atalk_unregister_sysctl(void) 65void atalk_unregister_sysctl(void)
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 859fe4d86698..141f069e77a0 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -967,24 +967,10 @@ static ctl_table brnf_table[] = {
967 { .ctl_name = 0 } 967 { .ctl_name = 0 }
968}; 968};
969 969
970static ctl_table brnf_bridge_table[] = { 970static struct ctl_path brnf_path[] = {
971 { 971 { .procname = "net", .ctl_name = CTL_NET, },
972 .ctl_name = NET_BRIDGE, 972 { .procname = "bridge", .ctl_name = NET_BRIDGE, },
973 .procname = "bridge", 973 { }
974 .mode = 0555,
975 .child = brnf_table,
976 },
977 { .ctl_name = 0 }
978};
979
980static ctl_table brnf_net_table[] = {
981 {
982 .ctl_name = CTL_NET,
983 .procname = "net",
984 .mode = 0555,
985 .child = brnf_bridge_table,
986 },
987 { .ctl_name = 0 }
988}; 974};
989#endif 975#endif
990 976
@@ -996,7 +982,7 @@ int __init br_netfilter_init(void)
996 if (ret < 0) 982 if (ret < 0)
997 return ret; 983 return ret;
998#ifdef CONFIG_SYSCTL 984#ifdef CONFIG_SYSCTL
999 brnf_sysctl_header = register_sysctl_table(brnf_net_table); 985 brnf_sysctl_header = register_sysctl_paths(brnf_path, brnf_table);
1000 if (brnf_sysctl_header == NULL) { 986 if (brnf_sysctl_header == NULL) {
1001 printk(KERN_WARNING 987 printk(KERN_WARNING
1002 "br_netfilter: can't register to sysctl.\n"); 988 "br_netfilter: can't register to sysctl.\n");
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c
index c62c05039f69..21295993fdb8 100644
--- a/net/dccp/sysctl.c
+++ b/net/dccp/sysctl.c
@@ -100,41 +100,19 @@ static struct ctl_table dccp_default_table[] = {
100 { .ctl_name = 0, } 100 { .ctl_name = 0, }
101}; 101};
102 102
103static struct ctl_table dccp_table[] = { 103static struct ctl_path dccp_path[] = {
104 { 104 { .procname = "net", .ctl_name = CTL_NET, },
105 .ctl_name = NET_DCCP_DEFAULT, 105 { .procname = "dccp", .ctl_name = NET_DCCP, },
106 .procname = "default", 106 { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
107 .mode = 0555, 107 { }
108 .child = dccp_default_table,
109 },
110 { .ctl_name = 0, },
111};
112
113static struct ctl_table dccp_dir_table[] = {
114 {
115 .ctl_name = NET_DCCP,
116 .procname = "dccp",
117 .mode = 0555,
118 .child = dccp_table,
119 },
120 { .ctl_name = 0, },
121};
122
123static struct ctl_table dccp_root_table[] = {
124 {
125 .ctl_name = CTL_NET,
126 .procname = "net",
127 .mode = 0555,
128 .child = dccp_dir_table,
129 },
130 { .ctl_name = 0, },
131}; 108};
132 109
133static struct ctl_table_header *dccp_table_header; 110static struct ctl_table_header *dccp_table_header;
134 111
135int __init dccp_sysctl_init(void) 112int __init dccp_sysctl_init(void)
136{ 113{
137 dccp_table_header = register_sysctl_table(dccp_root_table); 114 dccp_table_header = register_sysctl_paths(dccp_path,
115 dccp_default_table);
138 116
139 return dccp_table_header != NULL ? 0 : -ENOMEM; 117 return dccp_table_header != NULL ? 0 : -ENOMEM;
140} 118}
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index 0cf526450536..92fef864e852 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -28,31 +28,17 @@ static struct ctl_table ipx_table[] = {
28 { 0 }, 28 { 0 },
29}; 29};
30 30
31static struct ctl_table ipx_dir_table[] = { 31static struct ctl_path ipx_path[] = {
32 { 32 { .procname = "net", .ctl_name = CTL_NET, },
33 .ctl_name = NET_IPX, 33 { .procname = "ipx", .ctl_name = NET_IPX, },
34 .procname = "ipx", 34 { }
35 .mode = 0555,
36 .child = ipx_table,
37 },
38 { 0 },
39};
40
41static struct ctl_table ipx_root_table[] = {
42 {
43 .ctl_name = CTL_NET,
44 .procname = "net",
45 .mode = 0555,
46 .child = ipx_dir_table,
47 },
48 { 0 },
49}; 35};
50 36
51static struct ctl_table_header *ipx_table_header; 37static struct ctl_table_header *ipx_table_header;
52 38
53void ipx_register_sysctl(void) 39void ipx_register_sysctl(void)
54{ 40{
55 ipx_table_header = register_sysctl_table(ipx_root_table); 41 ipx_table_header = register_sysctl_paths(ipx_path, ipx_table);
56} 42}
57 43
58void ipx_unregister_sysctl(void) 44void ipx_unregister_sysctl(void)
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index 565cbf0421cd..d8aba869ff11 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -234,28 +234,10 @@ static ctl_table irda_table[] = {
234 { .ctl_name = 0 } 234 { .ctl_name = 0 }
235}; 235};
236 236
237/* One directory */ 237static struct ctl_path irda_path[] = {
238static ctl_table irda_net_table[] = { 238 { .procname = "net", .ctl_name = CTL_NET, },
239 { 239 { .procname = "irda", .ctl_name = NET_IRDA, },
240 .ctl_name = NET_IRDA, 240 { }
241 .procname = "irda",
242 .maxlen = 0,
243 .mode = 0555,
244 .child = irda_table