Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Pavel Emelyanov and committed by
David S. Miller
b5ccd792 cb7928a5

+52 -204
+5 -19
net/appletalk/sysctl_net_atalk.c
··· 49 49 { 0 }, 50 50 }; 51 51 52 - static struct ctl_table atalk_dir_table[] = { 53 - { 54 - .ctl_name = NET_ATALK, 55 - .procname = "appletalk", 56 - .mode = 0555, 57 - .child = atalk_table, 58 - }, 59 - { 0 }, 60 - }; 61 - 62 - static 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 }, 52 + static struct ctl_path atalk_path[] = { 53 + { .procname = "net", .ctl_name = CTL_NET, }, 54 + { .procname = "appletalk", .ctl_name = NET_ATALK, }, 55 + { } 70 56 }; 71 57 72 58 static struct ctl_table_header *atalk_table_header; 73 59 74 60 void 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 79 65 void atalk_unregister_sysctl(void)
+5 -19
net/bridge/br_netfilter.c
··· 967 967 { .ctl_name = 0 } 968 968 }; 969 969 970 - static ctl_table brnf_bridge_table[] = { 971 - { 972 - .ctl_name = NET_BRIDGE, 973 - .procname = "bridge", 974 - .mode = 0555, 975 - .child = brnf_table, 976 - }, 977 - { .ctl_name = 0 } 978 - }; 979 - 980 - static 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 } 970 + static struct ctl_path brnf_path[] = { 971 + { .procname = "net", .ctl_name = CTL_NET, }, 972 + { .procname = "bridge", .ctl_name = NET_BRIDGE, }, 973 + { } 988 974 }; 989 975 #endif 990 976 ··· 982 996 if (ret < 0) 983 997 return ret; 984 998 #ifdef CONFIG_SYSCTL 985 - brnf_sysctl_header = register_sysctl_table(brnf_net_table); 999 + brnf_sysctl_header = register_sysctl_paths(brnf_path, brnf_table); 986 1000 if (brnf_sysctl_header == NULL) { 987 1001 printk(KERN_WARNING 988 1002 "br_netfilter: can't register to sysctl.\n");
+7 -29
net/dccp/sysctl.c
··· 100 100 { .ctl_name = 0, } 101 101 }; 102 102 103 - static struct ctl_table dccp_table[] = { 104 - { 105 - .ctl_name = NET_DCCP_DEFAULT, 106 - .procname = "default", 107 - .mode = 0555, 108 - .child = dccp_default_table, 109 - }, 110 - { .ctl_name = 0, }, 111 - }; 112 - 113 - static 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 - 123 - static 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, }, 103 + static struct ctl_path dccp_path[] = { 104 + { .procname = "net", .ctl_name = CTL_NET, }, 105 + { .procname = "dccp", .ctl_name = NET_DCCP, }, 106 + { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, }, 107 + { } 131 108 }; 132 109 133 110 static struct ctl_table_header *dccp_table_header; 134 111 135 112 int __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 117 return dccp_table_header != NULL ? 0 : -ENOMEM; 140 118 }
+5 -19
net/ipx/sysctl_net_ipx.c
··· 28 28 { 0 }, 29 29 }; 30 30 31 - static struct ctl_table ipx_dir_table[] = { 32 - { 33 - .ctl_name = NET_IPX, 34 - .procname = "ipx", 35 - .mode = 0555, 36 - .child = ipx_table, 37 - }, 38 - { 0 }, 39 - }; 40 - 41 - static 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 }, 31 + static struct ctl_path ipx_path[] = { 32 + { .procname = "net", .ctl_name = CTL_NET, }, 33 + { .procname = "ipx", .ctl_name = NET_IPX, }, 34 + { } 49 35 }; 50 36 51 37 static struct ctl_table_header *ipx_table_header; 52 38 53 39 void 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 58 44 void ipx_unregister_sysctl(void)
+5 -23
net/irda/irsysctl.c
··· 234 234 { .ctl_name = 0 } 235 235 }; 236 236 237 - /* One directory */ 238 - static ctl_table irda_net_table[] = { 239 - { 240 - .ctl_name = NET_IRDA, 241 - .procname = "irda", 242 - .maxlen = 0, 243 - .mode = 0555, 244 - .child = irda_table 245 - }, 246 - { .ctl_name = 0 } 247 - }; 248 - 249 - /* The parent directory */ 250 - static 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 } 237 + static struct ctl_path irda_path[] = { 238 + { .procname = "net", .ctl_name = CTL_NET, }, 239 + { .procname = "irda", .ctl_name = NET_IRDA, }, 240 + { } 259 241 }; 260 242 261 243 static struct ctl_table_header *irda_table_header; ··· 250 268 */ 251 269 int __init irda_sysctl_register(void) 252 270 { 253 - irda_table_header = register_sysctl_table(irda_root_table); 271 + irda_table_header = register_sysctl_paths(irda_path, irda_table); 254 272 if (!irda_table_header) 255 273 return -ENOMEM; 256 274
+5 -19
net/llc/sysctl_net_llc.c
··· 92 92 { 0 }, 93 93 }; 94 94 95 - static struct ctl_table llc_dir_table[] = { 96 - { 97 - .ctl_name = NET_LLC, 98 - .procname = "llc", 99 - .mode = 0555, 100 - .child = llc_table, 101 - }, 102 - { 0 }, 103 - }; 104 - 105 - static 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 }, 95 + static struct ctl_path llc_path[] = { 96 + { .procname = "net", .ctl_name = CTL_NET, }, 97 + { .procname = "llc", .ctl_name = NET_LLC, }, 98 + { } 113 99 }; 114 100 115 101 static struct ctl_table_header *llc_table_header; 116 102 117 103 int __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 107 return llc_table_header ? 0 : -ENOMEM; 122 108 }
+5 -19
net/netrom/sysctl_net_netrom.c
··· 170 170 { .ctl_name = 0 } 171 171 }; 172 172 173 - static ctl_table nr_dir_table[] = { 174 - { 175 - .ctl_name = NET_NETROM, 176 - .procname = "netrom", 177 - .mode = 0555, 178 - .child = nr_table 179 - }, 180 - { .ctl_name = 0 } 181 - }; 182 - 183 - static 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 } 173 + static struct ctl_path nr_path[] = { 174 + { .procname = "net", .ctl_name = CTL_NET, }, 175 + { .procname = "netrom", .ctl_name = NET_NETROM, }, 176 + { } 191 177 }; 192 178 193 179 void __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 198 184 void nr_unregister_sysctl(void)
+5 -19
net/rose/sysctl_net_rose.c
··· 138 138 { .ctl_name = 0 } 139 139 }; 140 140 141 - static ctl_table rose_dir_table[] = { 142 - { 143 - .ctl_name = NET_ROSE, 144 - .procname = "rose", 145 - .mode = 0555, 146 - .child = rose_table 147 - }, 148 - { .ctl_name = 0 } 149 - }; 150 - 151 - static 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 } 141 + static struct ctl_path rose_path[] = { 142 + { .procname = "net", .ctl_name = CTL_NET, }, 143 + { .procname = "rose", .ctl_name = NET_ROSE, }, 144 + { } 159 145 }; 160 146 161 147 void __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 166 152 void rose_unregister_sysctl(void)
+5 -19
net/sctp/sysctl.c
··· 275 275 { .ctl_name = 0 } 276 276 }; 277 277 278 - static ctl_table sctp_net_table[] = { 279 - { 280 - .ctl_name = NET_SCTP, 281 - .procname = "sctp", 282 - .mode = 0555, 283 - .child = sctp_table 284 - }, 285 - { .ctl_name = 0 } 286 - }; 287 - 288 - static 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 } 278 + static struct ctl_path sctp_path[] = { 279 + { .procname = "net", .ctl_name = CTL_NET, }, 280 + { .procname = "sctp", .ctl_name = NET_SCTP, }, 281 + { } 296 282 }; 297 283 298 284 static struct ctl_table_header * sctp_sysctl_header; ··· 286 300 /* Sysctl registration. */ 287 301 void sctp_sysctl_register(void) 288 302 { 289 - sctp_sysctl_header = register_sysctl_table(sctp_root_table); 303 + sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table); 290 304 } 291 305 292 306 /* Sysctl deregistration. */
+5 -19
net/x25/sysctl_net_x25.c
··· 84 84 { 0, }, 85 85 }; 86 86 87 - static struct ctl_table x25_dir_table[] = { 88 - { 89 - .ctl_name = NET_X25, 90 - .procname = "x25", 91 - .mode = 0555, 92 - .child = x25_table, 93 - }, 94 - { 0, }, 95 - }; 96 - 97 - static 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, }, 87 + static struct ctl_path x25_path[] = { 88 + { .procname = "net", .ctl_name = CTL_NET, }, 89 + { .procname = "x25", .ctl_name = NET_X25, }, 90 + { } 105 91 }; 106 92 107 93 void __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 112 98 void x25_unregister_sysctl(void)