]> err.no Git - linux-2.6/commitdiff
[NET]: Simple ctl_table to ctl_path conversions.
authorPavel Emelyanov <xemul@openvz.org>
Wed, 9 Jan 2008 08:30:05 +0000 (00:30 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:01:07 +0000 (15:01 -0800)
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>
net/appletalk/sysctl_net_atalk.c
net/bridge/br_netfilter.c
net/dccp/sysctl.c
net/ipx/sysctl_net_ipx.c
net/irda/irsysctl.c
net/llc/sysctl_net_llc.c
net/netrom/sysctl_net_netrom.c
net/rose/sysctl_net_rose.c
net/sctp/sysctl.c
net/x25/sysctl_net_x25.c

index 7df1778e221a6f9ab3782789ffeb51af61ceb165..621805dfa2f4a4f84c9c0264dfc027935f2a85ac 100644 (file)
@@ -49,31 +49,17 @@ static struct ctl_table atalk_table[] = {
        { 0 },
 };
 
-static struct ctl_table atalk_dir_table[] = {
-       {
-               .ctl_name       = NET_ATALK,
-               .procname       = "appletalk",
-               .mode           = 0555,
-               .child          = atalk_table,
-       },
-       { 0 },
-};
-
-static struct ctl_table atalk_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = atalk_dir_table,
-       },
-       { 0 },
+static struct ctl_path atalk_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "appletalk", .ctl_name = NET_ATALK, },
+       { }
 };
 
 static struct ctl_table_header *atalk_table_header;
 
 void atalk_register_sysctl(void)
 {
-       atalk_table_header = register_sysctl_table(atalk_root_table);
+       atalk_table_header = register_sysctl_paths(atalk_path, atalk_table);
 }
 
 void atalk_unregister_sysctl(void)
index 859fe4d866985511af52a65890362bae5b11cf27..141f069e77a0cfc04408d6a5e0781d69fb043611 100644 (file)
@@ -967,24 +967,10 @@ static ctl_table brnf_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table brnf_bridge_table[] = {
-       {
-               .ctl_name       = NET_BRIDGE,
-               .procname       = "bridge",
-               .mode           = 0555,
-               .child          = brnf_table,
-       },
-       { .ctl_name = 0 }
-};
-
-static ctl_table brnf_net_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = brnf_bridge_table,
-       },
-       { .ctl_name = 0 }
+static struct ctl_path brnf_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "bridge", .ctl_name = NET_BRIDGE, },
+       { }
 };
 #endif
 
@@ -996,7 +982,7 @@ int __init br_netfilter_init(void)
        if (ret < 0)
                return ret;
 #ifdef CONFIG_SYSCTL
-       brnf_sysctl_header = register_sysctl_table(brnf_net_table);
+       brnf_sysctl_header = register_sysctl_paths(brnf_path, brnf_table);
        if (brnf_sysctl_header == NULL) {
                printk(KERN_WARNING
                       "br_netfilter: can't register to sysctl.\n");
index c62c05039f693e40bbd2b4cad307fa68d619629f..21295993fdb84f2dd53dea972b137eb95395aca2 100644 (file)
@@ -100,41 +100,19 @@ static struct ctl_table dccp_default_table[] = {
        { .ctl_name = 0, }
 };
 
-static struct ctl_table dccp_table[] = {
-       {
-               .ctl_name       = NET_DCCP_DEFAULT,
-               .procname       = "default",
-               .mode           = 0555,
-               .child          = dccp_default_table,
-       },
-       { .ctl_name = 0, },
-};
-
-static struct ctl_table dccp_dir_table[] = {
-       {
-               .ctl_name       = NET_DCCP,
-               .procname       = "dccp",
-               .mode           = 0555,
-               .child          = dccp_table,
-       },
-       { .ctl_name = 0, },
-};
-
-static struct ctl_table dccp_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = dccp_dir_table,
-       },
-       { .ctl_name = 0, },
+static struct ctl_path dccp_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "dccp", .ctl_name = NET_DCCP, },
+       { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
+       { }
 };
 
 static struct ctl_table_header *dccp_table_header;
 
 int __init dccp_sysctl_init(void)
 {
-       dccp_table_header = register_sysctl_table(dccp_root_table);
+       dccp_table_header = register_sysctl_paths(dccp_path,
+                       dccp_default_table);
 
        return dccp_table_header != NULL ? 0 : -ENOMEM;
 }
index 0cf52645053648c7444a86544537a2b54a0243a1..92fef864e85225a142fc778c8da4afc9e94cb5b9 100644 (file)
@@ -28,31 +28,17 @@ static struct ctl_table ipx_table[] = {
        { 0 },
 };
 
-static struct ctl_table ipx_dir_table[] = {
-       {
-               .ctl_name       = NET_IPX,
-               .procname       = "ipx",
-               .mode           = 0555,
-               .child          = ipx_table,
-       },
-       { 0 },
-};
-
-static struct ctl_table ipx_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = ipx_dir_table,
-       },
-       { 0 },
+static struct ctl_path ipx_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "ipx", .ctl_name = NET_IPX, },
+       { }
 };
 
 static struct ctl_table_header *ipx_table_header;
 
 void ipx_register_sysctl(void)
 {
-       ipx_table_header = register_sysctl_table(ipx_root_table);
+       ipx_table_header = register_sysctl_paths(ipx_path, ipx_table);
 }
 
 void ipx_unregister_sysctl(void)
index 565cbf0421cd69124e372aa9274ef9a43b3da393..d8aba869ff11d8bb21e45cf1cea6f397afc8fd91 100644 (file)
@@ -234,28 +234,10 @@ static ctl_table irda_table[] = {
        { .ctl_name = 0 }
 };
 
-/* One directory */
-static ctl_table irda_net_table[] = {
-       {
-               .ctl_name       = NET_IRDA,
-               .procname       = "irda",
-               .maxlen         = 0,
-               .mode           = 0555,
-               .child          = irda_table
-       },
-       { .ctl_name = 0 }
-};
-
-/* The parent directory */
-static ctl_table irda_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .maxlen         = 0,
-               .mode           = 0555,
-               .child          = irda_net_table
-       },
-       { .ctl_name = 0 }
+static struct ctl_path irda_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "irda", .ctl_name = NET_IRDA, },
+       { }
 };
 
 static struct ctl_table_header *irda_table_header;
@@ -268,7 +250,7 @@ static struct ctl_table_header *irda_table_header;
  */
 int __init irda_sysctl_register(void)
 {
-       irda_table_header = register_sysctl_table(irda_root_table);
+       irda_table_header = register_sysctl_paths(irda_path, irda_table);
        if (!irda_table_header)
                return -ENOMEM;
 
index 46992d03601766503cc9250a25cda2b27ddccb3a..5bef1dcf18e3c1ec060dcdb4f4047376d2a0f417 100644 (file)
@@ -92,31 +92,17 @@ static struct ctl_table llc_table[] = {
        { 0 },
 };
 
-static struct ctl_table llc_dir_table[] = {
-       {
-               .ctl_name       = NET_LLC,
-               .procname       = "llc",
-               .mode           = 0555,
-               .child          = llc_table,
-       },
-       { 0 },
-};
-
-static struct ctl_table llc_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = llc_dir_table,
-       },
-       { 0 },
+static struct ctl_path llc_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "llc", .ctl_name = NET_LLC, },
+       { }
 };
 
 static struct ctl_table_header *llc_table_header;
 
 int __init llc_sysctl_init(void)
 {
-       llc_table_header = register_sysctl_table(llc_root_table);
+       llc_table_header = register_sysctl_paths(llc_path, llc_table);
 
        return llc_table_header ? 0 : -ENOMEM;
 }
index 2ea68da01fb836bf8f8ae5fa4b70c13686df12e7..34c96c9674dfd838c9061d2a0afde9211ea4bed3 100644 (file)
@@ -170,29 +170,15 @@ static ctl_table nr_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table nr_dir_table[] = {
-       {
-               .ctl_name       = NET_NETROM,
-               .procname       = "netrom",
-               .mode           = 0555,
-               .child          = nr_table
-       },
-       { .ctl_name = 0 }
-};
-
-static ctl_table nr_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = nr_dir_table
-       },
-       { .ctl_name = 0 }
+static struct ctl_path nr_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "netrom", .ctl_name = NET_NETROM, },
+       { }
 };
 
 void __init nr_register_sysctl(void)
 {
-       nr_table_header = register_sysctl_table(nr_root_table);
+       nr_table_header = register_sysctl_paths(nr_path, nr_table);
 }
 
 void nr_unregister_sysctl(void)
index 455b0555a6695518621ca558a19c77acf6410534..20be3485a97f9981971481b0915a01157e0e24e1 100644 (file)
@@ -138,29 +138,15 @@ static ctl_table rose_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table rose_dir_table[] = {
-       {
-               .ctl_name       = NET_ROSE,
-               .procname       = "rose",
-               .mode           = 0555,
-               .child          = rose_table
-       },
-       { .ctl_name = 0 }
-};
-
-static ctl_table rose_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = rose_dir_table
-       },
-       { .ctl_name = 0 }
+static struct ctl_path rose_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "rose", .ctl_name = NET_ROSE, },
+       { }
 };
 
 void __init rose_register_sysctl(void)
 {
-       rose_table_header = register_sysctl_table(rose_root_table);
+       rose_table_header = register_sysctl_paths(rose_path, rose_table);
 }
 
 void rose_unregister_sysctl(void)
index da4f15734fb11f4e739059d5d0be49300ca3bbe8..5eb6ea829b5440b749199b08be6d15951b3eade0 100644 (file)
@@ -275,24 +275,10 @@ static ctl_table sctp_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table sctp_net_table[] = {
-       {
-               .ctl_name       = NET_SCTP,
-               .procname       = "sctp",
-               .mode           = 0555,
-               .child          = sctp_table
-       },
-       { .ctl_name = 0 }
-};
-
-static ctl_table sctp_root_table[] = {
-       {
-               .ctl_name       = CTL_NET,
-               .procname       = "net",
-               .mode           = 0555,
-               .child          = sctp_net_table
-       },
-       { .ctl_name = 0 }
+static struct ctl_path sctp_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "sctp", .ctl_name = NET_SCTP, },
+       { }
 };
 
 static struct ctl_table_header * sctp_sysctl_header;
@@ -300,7 +286,7 @@ static struct ctl_table_header * sctp_sysctl_header;
 /* Sysctl registration.  */
 void sctp_sysctl_register(void)
 {
-       sctp_sysctl_header = register_sysctl_table(sctp_root_table);
+       sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table);
 }
 
 /* Sysctl deregistration.  */
index a59b77f18234d498748d8dac63f55889eb742f03..6ebda25c24e96a4471ee7eb8aa3db69b2411075d 100644 (file)
@@ -84,29 +84,15 @@ static struct ctl_table x25_table[] = {
        { 0, },
 };
 
-static struct ctl_table x25_dir_table[] = {
-       {
-               .ctl_name =     NET_X25,
-               .procname =     "x25",
-               .mode =         0555,
-               .child =        x25_table,
-       },
-       { 0, },
-};
-
-static struct ctl_table x25_root_table[] = {
-       {
-               .ctl_name =     CTL_NET,
-               .procname =     "net",
-               .mode =         0555,
-               .child =        x25_dir_table,
-       },
-       { 0, },
+static struct ctl_path x25_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "x25", .ctl_name = NET_X25, },
+       { }
 };
 
 void __init x25_register_sysctl(void)
 {
-       x25_table_header = register_sysctl_table(x25_root_table);
+       x25_table_header = register_sysctl_paths(x25_path, x25_table);
 }
 
 void x25_unregister_sysctl(void)