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
245 },
246 { .ctl_name = 0 }
247};
248
249/* The parent directory */
250static ctl_table irda_root_table[] = {
251 {
252 .ctl_name = CTL_NET,
253 .procname = "net",
254 .maxlen = 0,
255 .mode = 0555,
256 .child = irda_net_table
257 },
258 { .ctl_name = 0 }
259}; 241};
260 242
261static struct ctl_table_header *irda_table_header; 243static struct ctl_table_header *irda_table_header;
@@ -268,7 +250,7 @@ static struct ctl_table_header *irda_table_header;
268 */ 250 */
269int __init irda_sysctl_register(void) 251int __init irda_sysctl_register(void)
270{ 252{
271 irda_table_header = register_sysctl_table(irda_root_table); 253 irda_table_header = register_sysctl_paths(irda_path, irda_table);
272 if (!irda_table_header) 254 if (!irda_table_header)
273 return -ENOMEM; 255 return -ENOMEM;
274 256
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index 46992d036017..5bef1dcf18e3 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -92,31 +92,17 @@ static struct ctl_table llc_table[] = {
92 { 0 }, 92 { 0 },
93}; 93};
94 94
95static struct ctl_table llc_dir_table[] = { 95static struct ctl_path llc_path[] = {
96 { 96 { .procname = "net", .ctl_name = CTL_NET, },
97 .ctl_name = NET_LLC, 97 { .procname = "llc", .ctl_name = NET_LLC, },
98 .procname = "llc", 98 { }
99 .mode = 0555,
100 .child = llc_table,
101 },
102 { 0 },
103};
104
105static struct ctl_table llc_root_table[] = {
106 {
107 .ctl_name = CTL_NET,
108 .procname = "net",
109 .mode = 0555,
110 .child = llc_dir_table,
111 },
112 { 0 },
113}; 99};
114 100
115static struct ctl_table_header *llc_table_header; 101static struct ctl_table_header *llc_table_header;
116 102
117int __init llc_sysctl_init(void) 103int __init llc_sysctl_init(void)
118{ 104{
119 llc_table_header = register_sysctl_table(llc_root_table); 105 llc_table_header = register_sysctl_paths(llc_path, llc_table);
120 106
121 return llc_table_header ? 0 : -ENOMEM; 107 return llc_table_header ? 0 : -ENOMEM;
122} 108}
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index 2ea68da01fb8..34c96c9674df 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -170,29 +170,15 @@ static ctl_table nr_table[] = {
170 { .ctl_name = 0 } 170 { .ctl_name = 0 }
171}; 171};
172 172
173static ctl_table nr_dir_table[] = { 173static struct ctl_path nr_path[] = {
174 { 174 { .procname = "net", .ctl_name = CTL_NET, },
175 .ctl_name = NET_NETROM, 175 { .procname = "netrom", .ctl_name = NET_NETROM, },
176 .procname = "netrom", 176 { }
177 .mode = 0555,
178 .child = nr_table
179 },
180 { .ctl_name = 0 }
181};
182
183static ctl_table nr_root_table[] = {
184 {
185 .ctl_name = CTL_NET,
186 .procname = "net",
187 .mode = 0555,
188 .child = nr_dir_table
189 },
190 { .ctl_name = 0 }
191}; 177};
192 178
193void __init nr_register_sysctl(void) 179void __init nr_register_sysctl(void)
194{ 180{
195 nr_table_header = register_sysctl_table(nr_root_table); 181 nr_table_header = register_sysctl_paths(nr_path, nr_table);
196} 182}
197 183
198void nr_unregister_sysctl(void) 184void nr_unregister_sysctl(void)
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c
index 455b0555a669..20be3485a97f 100644
--- a/net/rose/sysctl_net_rose.c
+++ b/net/rose/sysctl_net_rose.c
@@ -138,29 +138,15 @@ static ctl_table rose_table[] = {
138 { .ctl_name = 0 } 138 { .ctl_name = 0 }
139}; 139};
140 140
141static ctl_table rose_dir_table[] = { 141static struct ctl_path rose_path[] = {
142 { 142 { .procname = "net", .ctl_name = CTL_NET, },
143 .ctl_name = NET_ROSE, 143 { .procname = "rose", .ctl_name = NET_ROSE, },
144 .procname = "rose", 144 { }
145 .mode = 0555,
146 .child = rose_table
147 },
148 { .ctl_name = 0 }
149};
150
151static ctl_table rose_root_table[] = {
152 {
153 .ctl_name = CTL_NET,
154 .procname = "net",
155 .mode = 0555,
156 .child = rose_dir_table
157 },
158 { .ctl_name = 0 }
159}; 145};
160 146
161void __init rose_register_sysctl(void) 147void __init rose_register_sysctl(void)
162{ 148{
163 rose_table_header = register_sysctl_table(rose_root_table); 149 rose_table_header = register_sysctl_paths(rose_path, rose_table);
164} 150}
165 151
166void rose_unregister_sysctl(void) 152void rose_unregister_sysctl(void)
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index da4f15734fb1..5eb6ea829b54 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -275,24 +275,10 @@ static ctl_table sctp_table[] = {
275 { .ctl_name = 0 } 275 { .ctl_name = 0 }
276}; 276};
277 277
278static ctl_table sctp_net_table[] = { 278static struct ctl_path sctp_path[] = {
279 { 279 { .procname = "net", .ctl_name = CTL_NET, },
280 .ctl_name = NET_SCTP, 280 { .procname = "sctp", .ctl_name = NET_SCTP, },
281 .procname = "sctp", 281 { }
282 .mode = 0555,
283 .child = sctp_table
284 },
285 { .ctl_name = 0 }
286};
287
288static ctl_table sctp_root_table[] = {
289 {
290 .ctl_name = CTL_NET,
291 .procname = "net",
292 .mode = 0555,
293 .child = sctp_net_table
294 },
295 { .ctl_name = 0 }
296}; 282};
297 283
298static struct ctl_table_header * sctp_sysctl_header; 284static struct ctl_table_header * sctp_sysctl_header;
@@ -300,7 +286,7 @@ static struct ctl_table_header * sctp_sysctl_header;
300/* Sysctl registration. */ 286/* Sysctl registration. */
301void sctp_sysctl_register(void) 287void sctp_sysctl_register(void)
302{ 288{
303 sctp_sysctl_header = register_sysctl_table(sctp_root_table); 289 sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table);
304} 290}
305 291
306/* Sysctl deregistration. */ 292/* Sysctl deregistration. */
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c
index a59b77f18234..6ebda25c24e9 100644
--- a/net/x25/sysctl_net_x25.c
+++ b/net/x25/sysctl_net_x25.c
@@ -84,29 +84,15 @@ static struct ctl_table x25_table[] = {
84 { 0, }, 84 { 0, },
85}; 85};
86 86
87static struct ctl_table x25_dir_table[] = { 87static struct ctl_path x25_path[] = {
88 { 88 { .procname = "net", .ctl_name = CTL_NET, },
89 .ctl_name = NET_X25, 89 { .procname = "x25", .ctl_name = NET_X25, },
90 .procname = "x25", 90 { }
91 .mode = 0555,
92 .child = x25_table,
93 },
94 { 0, },
95};
96
97static struct ctl_table x25_root_table[] = {
98 {
99 .ctl_name = CTL_NET,
100 .procname = "net",
101 .mode = 0555,
102 .child = x25_dir_table,
103 },
104 { 0, },
105}; 91};
106 92
107void __init x25_register_sysctl(void) 93void __init x25_register_sysctl(void)
108{ 94{
109 x25_table_header = register_sysctl_table(x25_root_table); 95 x25_table_header = register_sysctl_paths(x25_path, x25_table);
110} 96}
111 97
112void x25_unregister_sysctl(void) 98void x25_unregister_sysctl(void)