net: Convert all sysctl registrations to register_net_sysctl
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 19 Apr 2012 13:44:49 +0000 (13:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Apr 2012 01:22:30 +0000 (21:22 -0400)
This results in code with less boiler plate that is a bit easier
to read.

Additionally stops us from using compatibility code in the sysctl
core, hastening the day when the compatibility code can be removed.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
36 files changed:
drivers/infiniband/core/ucma.c
net/802/tr.c
net/appletalk/sysctl_net_atalk.c
net/bridge/br_netfilter.c
net/core/sysctl_net_core.c
net/dccp/sysctl.c
net/ipv4/ip_fragment.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/xfrm4_policy.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/reassembly.c
net/ipv6/xfrm6_policy.c
net/ipx/sysctl_net_ipx.c
net/irda/irsysctl.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/nf_conntrack_acct.c
net/netfilter/nf_conntrack_ecache.c
net/netfilter/nf_conntrack_proto_dccp.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_conntrack_timestamp.c
net/netfilter/nf_log.c
net/netrom/sysctl_net_netrom.c
net/phonet/sysctl.c
net/rds/ib_sysctl.c
net/rds/iw_sysctl.c
net/rds/sysctl.c
net/rose/sysctl_net_rose.c
net/sctp/sysctl.c
net/unix/sysctl_net_unix.c
net/x25/sysctl_net_x25.c
net/xfrm/xfrm_sysctl.c

index 9f3e2beec91d8ca59bf1d2af1e7c30c836c2dc29..8002ae642cfebfb692364d85ac87fc0f7b6e5ca5 100644 (file)
@@ -66,12 +66,6 @@ static ctl_table ucma_ctl_table[] = {
        { }
 };
 
-static struct ctl_path ucma_ctl_path[] = {
-       { .procname = "net" },
-       { .procname = "rdma_ucm" },
-       { }
-};
-
 struct ucma_file {
        struct mutex            mut;
        struct file             *filp;
@@ -1392,7 +1386,7 @@ static int __init ucma_init(void)
                goto err1;
        }
 
-       ucma_ctl_table_hdr = register_net_sysctl_table(&init_net, ucma_ctl_path, ucma_ctl_table);
+       ucma_ctl_table_hdr = register_net_sysctl(&init_net, "net/rdma_ucm", ucma_ctl_table);
        if (!ucma_ctl_table_hdr) {
                printk(KERN_ERR "rdma_ucm: couldn't register sysctl paths\n");
                ret = -ENOMEM;
index 103e0201b0abe4fbf331ca4337bf6add48072e3e..30a352ed09b1bfc9ecd95d26ccfa5f28db8b9d47 100644 (file)
@@ -643,12 +643,6 @@ static struct ctl_table tr_table[] = {
        },
        { },
 };
-
-static __initdata struct ctl_path tr_path[] = {
-       { .procname = "net", },
-       { .procname = "token-ring", },
-       { }
-};
 #endif
 
 /*
@@ -662,7 +656,7 @@ static int __init rif_init(void)
        setup_timer(&rif_timer, rif_check_expire, 0);
        add_timer(&rif_timer);
 #ifdef CONFIG_SYSCTL
-       register_net_sysctl_table(&init_net, tr_path, tr_table);
+       register_net_sysctl(&init_net, "net/token-ring", tr_table);
 #endif
        proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
        return 0;
index 5edce8f70cb79180019afe308d83637276c59192..ebb864361f7a27a713f2dc14194787346557b320 100644 (file)
@@ -42,17 +42,11 @@ static struct ctl_table atalk_table[] = {
        { },
 };
 
-static struct ctl_path atalk_path[] = {
-       { .procname = "net", },
-       { .procname = "appletalk", },
-       { }
-};
-
 static struct ctl_table_header *atalk_table_header;
 
 void atalk_register_sysctl(void)
 {
-       atalk_table_header = register_net_sysctl_table(&init_net, atalk_path, atalk_table);
+       atalk_table_header = register_net_sysctl(&init_net, "net/appletalk", atalk_table);
 }
 
 void atalk_unregister_sysctl(void)
index 4f4c4a619f680dbbdad4b8691bf4a856e693bab2..9d4f09c3520fb9d58ea8a2b936b1614baacba908 100644 (file)
@@ -1008,12 +1008,6 @@ static ctl_table brnf_table[] = {
        },
        { }
 };
-
-static struct ctl_path brnf_path[] = {
-       { .procname = "net", },
-       { .procname = "bridge", },
-       { }
-};
 #endif
 
 int __init br_netfilter_init(void)
@@ -1030,7 +1024,7 @@ int __init br_netfilter_init(void)
                return ret;
        }
 #ifdef CONFIG_SYSCTL
-       brnf_sysctl_header = register_net_sysctl_table(&init_net, brnf_path, brnf_table);
+       brnf_sysctl_header = register_net_sysctl(&init_net, "net/bridge", brnf_table);
        if (brnf_sysctl_header == NULL) {
                printk(KERN_WARNING
                       "br_netfilter: can't register to sysctl.\n");
index 9fc2f9d666a9a346928c316f6c9fdf5bad8385f8..64924e345a9b07cbdc2dc25dbe5b6dfd09596a0a 100644 (file)
@@ -224,8 +224,7 @@ static __net_init int sysctl_core_net_init(struct net *net)
                tbl[0].data = &net->core.sysctl_somaxconn;
        }
 
-       net->core.sysctl_hdr = register_net_sysctl_table(net,
-                       net_core_path, tbl);
+       net->core.sysctl_hdr = register_net_sysctl(net, "net/core", tbl);
        if (net->core.sysctl_hdr == NULL)
                goto err_reg;
 
index 329e1390c26dfd1514edb3bc2d2835e7a6bdf395..607ab71b5a0cb3af65067e7d69badb862d5bfb5a 100644 (file)
@@ -98,18 +98,11 @@ static struct ctl_table dccp_default_table[] = {
        { }
 };
 
-static struct ctl_path dccp_path[] = {
-       { .procname = "net", },
-       { .procname = "dccp", },
-       { .procname = "default", },
-       { }
-};
-
 static struct ctl_table_header *dccp_table_header;
 
 int __init dccp_sysctl_init(void)
 {
-       dccp_table_header = register_net_sysctl_table(&init_net, dccp_path,
+       dccp_table_header = register_net_sysctl(&init_net, "net/dccp/default",
                        dccp_default_table);
 
        return dccp_table_header != NULL ? 0 : -ENOMEM;
index 6a2f85cd440e9beade74472d966cd804a34be730..71e5c328176c0e1527b4a921a4c172f7b7c871cb 100644 (file)
@@ -782,7 +782,7 @@ static int __net_init ip4_frags_ns_ctl_register(struct net *net)
                table[2].data = &net->ipv4.frags.timeout;
        }
 
-       hdr = register_net_sysctl_table(net, net_ipv4_ctl_path, table);
+       hdr = register_net_sysctl(net, "net/ipv4", table);
        if (hdr == NULL)
                goto err_reg;
 
index 766485d7d099c70ad7a720721343b14364a011ff..09775a1e134873ca02189be43debf7e601b56f9b 100644 (file)
@@ -586,7 +586,7 @@ static int __init ip_queue_init(void)
 #endif
        register_netdevice_notifier(&ipq_dev_notifier);
 #ifdef CONFIG_SYSCTL
-       ipq_sysctl_header = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, ipq_table);
+       ipq_sysctl_header = register_net_sysctl(&init_net, "net/ipv4", ipq_table);
 #endif
        status = nf_register_queue_handler(NFPROTO_IPV4, &nfqh);
        if (status < 0) {
index adf2105a6e85c227e1c6a604e8e838f355f80460..5773f5d9e213e4319075a4dfb2bb3e22728b20f1 100644 (file)
@@ -3354,13 +3354,6 @@ static struct ctl_table ipv4_route_flush_table[] = {
        { },
 };
 
-static __net_initdata struct ctl_path ipv4_route_path[] = {
-       { .procname = "net", },
-       { .procname = "ipv4", },
-       { .procname = "route", },
-       { },
-};
-
 static __net_init int sysctl_route_net_init(struct net *net)
 {
        struct ctl_table *tbl;
@@ -3373,8 +3366,7 @@ static __net_init int sysctl_route_net_init(struct net *net)
        }
        tbl[0].extra1 = net;
 
-       net->ipv4.route_hdr =
-               register_net_sysctl_table(net, ipv4_route_path, tbl);
+       net->ipv4.route_hdr = register_net_sysctl(net, "net/ipv4/route", tbl);
        if (net->ipv4.route_hdr == NULL)
                goto err_reg;
        return 0;
index e7a6fa3d70bb5d295b6be1e0794e7d7c9681af14..56e64f7b75d08b1fbb47c27990f27a0fb4835a0e 100644 (file)
@@ -815,8 +815,7 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
 
        tcp_init_mem(net);
 
-       net->ipv4.ipv4_hdr = register_net_sysctl_table(net,
-                       net_ipv4_ctl_path, table);
+       net->ipv4.ipv4_hdr = register_net_sysctl(net, "net/ipv4", table);
        if (net->ipv4.ipv4_hdr == NULL)
                goto err_reg;
 
@@ -857,7 +856,7 @@ static __init int sysctl_ipv4_init(void)
        if (!i->procname)
                return -EINVAL;
 
-       hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, ipv4_table);
+       hdr = register_net_sysctl(&init_net, "net/ipv4", ipv4_table);
        if (hdr == NULL)
                return -ENOMEM;
 
index 8ef24e16afce08c3d15984931bbf4566f41f09a0..0d3426cb5c4f8db5e382cb5639b612ec97d2835d 100644 (file)
@@ -298,8 +298,8 @@ void __init xfrm4_init(int rt_max_size)
        xfrm4_state_init();
        xfrm4_policy_init();
 #ifdef CONFIG_SYSCTL
-       sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path,
-                                               xfrm4_policy_table);
+       sysctl_hdr = register_net_sysctl(&init_net, "net/ipv4",
+                                        xfrm4_policy_table);
 #endif
 }
 
index 6785f5044acfe63d1dfeff4911a4e4ec63cb534d..3ca9303b3a196154420895b9d1334341a435141f 100644 (file)
@@ -588,7 +588,7 @@ static int __init ip6_queue_init(void)
 #endif
        register_netdevice_notifier(&ipq_dev_notifier);
 #ifdef CONFIG_SYSCTL
-       ipq_sysctl_header = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, ipq_table);
+       ipq_sysctl_header = register_net_sysctl(&init_net, "net/ipv6", ipq_table);
 #endif
        status = nf_register_queue_handler(NFPROTO_IPV6, &nfqh);
        if (status < 0) {
index 754814462950b0e329ffbda7e0c6c02d34764787..48a2be1b7c7029d69235b0198d7d6d53310792d9 100644 (file)
@@ -626,8 +626,8 @@ int nf_ct_frag6_init(void)
        inet_frags_init(&nf_frags);
 
 #ifdef CONFIG_SYSCTL
-       nf_ct_frag6_sysctl_header = register_net_sysctl_table(&init_net, nf_net_netfilter_sysctl_path,
-                                                         nf_ct_frag6_sysctl_table);
+       nf_ct_frag6_sysctl_header = register_net_sysctl(&init_net, "net/netfilter",
+                                                       nf_ct_frag6_sysctl_table);
        if (!nf_ct_frag6_sysctl_header) {
                inet_frags_fini(&nf_frags);
                return -ENOMEM;
index 42f4f7c0948a1fdc0cb07dd656512701294096f2..36e04cff1a85062178ee30fcc65f6300d824e852 100644 (file)
@@ -646,7 +646,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
                table[2].data = &net->ipv6.frags.timeout;
        }
 
-       hdr = register_net_sysctl_table(net, net_ipv6_ctl_path, table);
+       hdr = register_net_sysctl(net, "net/ipv6", table);
        if (hdr == NULL)
                goto err_reg;
 
index 8ea65e032733731d15b7579a1047f56d307cbbe3..8625fba96db90c58770f34bddad99e161dfde1a3 100644 (file)
@@ -334,8 +334,8 @@ int __init xfrm6_init(void)
                goto out_policy;
 
 #ifdef CONFIG_SYSCTL
-       sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path,
-                                               xfrm6_policy_table);
+       sysctl_hdr = register_net_sysctl(&init_net, "net/ipv6",
+                                        xfrm6_policy_table);
 #endif
 out:
        return ret;
index 035880709e840302f3a1498988d508e0ca07b1ef..ad7c03dedaab831c259f2041767227d955e584f3 100644 (file)
@@ -28,17 +28,11 @@ static struct ctl_table ipx_table[] = {
        { },
 };
 
-static struct ctl_path ipx_path[] = {
-       { .procname = "net", },
-       { .procname = "ipx", },
-       { }
-};
-
 static struct ctl_table_header *ipx_table_header;
 
 void ipx_register_sysctl(void)
 {
-       ipx_table_header = register_net_sysctl_table(&init_net, ipx_path, ipx_table);
+       ipx_table_header = register_net_sysctl(&init_net, "net/ipx", ipx_table);
 }
 
 void ipx_unregister_sysctl(void)
index 20ced38fc371371a1932361f46d3d51588f6d992..de73f6496db5a4842c54e1c5a9013e01f39a8988 100644 (file)
@@ -235,12 +235,6 @@ static ctl_table irda_table[] = {
        { }
 };
 
-static struct ctl_path irda_path[] = {
-       { .procname = "net", },
-       { .procname = "irda", },
-       { }
-};
-
 static struct ctl_table_header *irda_table_header;
 
 /*
@@ -251,7 +245,7 @@ static struct ctl_table_header *irda_table_header;
  */
 int __init irda_sysctl_register(void)
 {
-       irda_table_header = register_net_sysctl_table(&init_net, irda_path, irda_table);
+       irda_table_header = register_net_sysctl(&init_net, "net/irda", irda_table);
        if (!irda_table_header)
                return -ENOMEM;
 
index b8d0df7012274e3b0c53ce16a548b68067a38533..a606d6b1b0e5c2e9a7f4ee9ee19fbdb9ef2347c1 100644 (file)
@@ -3672,8 +3672,7 @@ int __net_init ip_vs_control_net_init_sysctl(struct net *net)
        tbl[idx++].data = &ipvs->sysctl_nat_icmp_send;
 
 
-       ipvs->sysctl_hdr = register_net_sysctl_table(net, net_vs_ctl_path,
-                                                    tbl);
+       ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl);
        if (ipvs->sysctl_hdr == NULL) {
                if (!net_eq(net, &init_net))
                        kfree(tbl);
index 27c24f156c28c872c26158a39ef10e6b8e8a4800..1024466de124c39532fd1781e50e9a6aac1acb70 100644 (file)
@@ -563,8 +563,7 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
        ipvs->lblc_ctl_table[0].data = &ipvs->sysctl_lblc_expiration;
 
        ipvs->lblc_ctl_header =
-               register_net_sysctl_table(net, net_vs_ctl_path,
-                                         ipvs->lblc_ctl_table);
+               register_net_sysctl(net, "net/ipv4/vs", ipvs->lblc_ctl_table);
        if (!ipvs->lblc_ctl_header) {
                if (!net_eq(net, &init_net))
                        kfree(ipvs->lblc_ctl_table);
index 749875611ed65365d7e3ad7f9a1134ab492bbdc8..9261825a657923bd7e704a15f500ad941b7a078e 100644 (file)
@@ -757,8 +757,7 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
        ipvs->lblcr_ctl_table[0].data = &ipvs->sysctl_lblcr_expiration;
 
        ipvs->lblcr_ctl_header =
-               register_net_sysctl_table(net, net_vs_ctl_path,
-                                         ipvs->lblcr_ctl_table);
+               register_net_sysctl(net, "net/ipv4/vs", ipvs->lblcr_ctl_table);
        if (!ipvs->lblcr_ctl_header) {
                if (!net_eq(net, &init_net))
                        kfree(ipvs->lblcr_ctl_table);
index f4f8cda05986cc09d4283c9a753e7d29a5508e0b..d61e0782a797db1d4f4548ef583108f08272b6f4 100644 (file)
@@ -69,8 +69,8 @@ static int nf_conntrack_acct_init_sysctl(struct net *net)
 
        table[0].data = &net->ct.sysctl_acct;
 
-       net->ct.acct_sysctl_header = register_net_sysctl_table(net,
-                       nf_net_netfilter_sysctl_path, table);
+       net->ct.acct_sysctl_header = register_net_sysctl(net, "net/netfilter",
+                                                        table);
        if (!net->ct.acct_sysctl_header) {
                printk(KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n");
                goto out_register;
index 5bd3047ddeec5cf38b160931777fb6c63e6c59b4..b924f3a49a8e5c40cd4b71e38e5f70cbe2c6c2c3 100644 (file)
@@ -199,8 +199,7 @@ static int nf_conntrack_event_init_sysctl(struct net *net)
        table[1].data = &net->ct.sysctl_events_retry_timeout;
 
        net->ct.event_sysctl_header =
-               register_net_sysctl_table(net,
-                                         nf_net_netfilter_sysctl_path, table);
+               register_net_sysctl(net, "net/netfilter", table);
        if (!net->ct.event_sysctl_header) {
                printk(KERN_ERR "nf_ct_event: can't register to sysctl.\n");
                goto out_register;
index a58998d0912fe556e123e2d4c1510638290b38f0..ef706a485be11d79f84df30b253af5b477542127 100644 (file)
@@ -910,8 +910,8 @@ static __net_init int dccp_net_init(struct net *net)
        dn->sysctl_table[6].data = &dn->dccp_timeout[CT_DCCP_TIMEWAIT];
        dn->sysctl_table[7].data = &dn->dccp_loose;
 
-       dn->sysctl_header = register_net_sysctl_table(net,
-                       nf_net_netfilter_sysctl_path, dn->sysctl_table);
+       dn->sysctl_header = register_net_sysctl(net, "net/netfilter",
+                                               dn->sysctl_table);
        if (!dn->sysctl_header) {
                kfree(dn->sysctl_table);
                return -ENOMEM;
index 0c3888de0f551fd76327cf96184ff3c4db9b2f6f..9b3943252a5e9c0b0dd6d2127606d11ac4e502b9 100644 (file)
@@ -468,18 +468,13 @@ static ctl_table nf_ct_netfilter_table[] = {
        { }
 };
 
-static struct ctl_path nf_ct_path[] = {
-       { .procname = "net", },
-       { }
-};
-
 static int nf_conntrack_standalone_init_sysctl(struct net *net)
 {
        struct ctl_table *table;
 
        if (net_eq(net, &init_net)) {
                nf_ct_netfilter_header =
-                      register_net_sysctl_table(&init_net, nf_ct_path, nf_ct_netfilter_table);
+                      register_net_sysctl(&init_net, "net", nf_ct_netfilter_table);
                if (!nf_ct_netfilter_header)
                        goto out;
        }
@@ -494,8 +489,7 @@ static int nf_conntrack_standalone_init_sysctl(struct net *net)
        table[3].data = &net->ct.sysctl_checksum;
        table[4].data = &net->ct.sysctl_log_invalid;
 
-       net->ct.sysctl_header = register_net_sysctl_table(net,
-                                       nf_net_netfilter_sysctl_path, table);
+       net->ct.sysctl_header = register_net_sysctl(net, "net/netfilter", table);
        if (!net->ct.sysctl_header)
                goto out_unregister_netfilter;
 
index e8d27afbbdb90f01b7a7f24a3cb7e5ece2bed7ec..dbb364f62d6f03b593b7b804251f48c2dcf7b845 100644 (file)
@@ -51,8 +51,8 @@ static int nf_conntrack_tstamp_init_sysctl(struct net *net)
 
        table[0].data = &net->ct.sysctl_tstamp;
 
-       net->ct.tstamp_sysctl_header = register_net_sysctl_table(net,
-                       nf_net_netfilter_sysctl_path, table);
+       net->ct.tstamp_sysctl_header = register_net_sysctl(net, "net/netfilter",
+                                                          table);
        if (!net->ct.tstamp_sysctl_header) {
                printk(KERN_ERR "nf_ct_tstamp: can't register to sysctl.\n");
                goto out_register;
index 04fca48d901aa27f407ef18eaa0c04645cee93ba..703fb26aa48d288fa3de60a79f58b43b56c43f78 100644 (file)
@@ -214,13 +214,6 @@ static const struct file_operations nflog_file_ops = {
 #endif /* PROC_FS */
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_path nf_log_sysctl_path[] = {
-       { .procname = "net", },
-       { .procname = "netfilter", },
-       { .procname = "nf_log", },
-       { }
-};
-
 static char nf_log_sysctl_fnames[NFPROTO_NUMPROTO-NFPROTO_UNSPEC][3];
 static struct ctl_table nf_log_sysctl_table[NFPROTO_NUMPROTO+1];
 static struct ctl_table_header *nf_log_dir_header;
@@ -283,7 +276,7 @@ static __init int netfilter_log_sysctl_init(void)
                nf_log_sysctl_table[i].extra1 = (void *)(unsigned long) i;
        }
 
-       nf_log_dir_header = register_net_sysctl_table(&init_net, nf_log_sysctl_path,
+       nf_log_dir_header = register_net_sysctl(&init_net, "net/netfilter/nf_log",
                                       nf_log_sysctl_table);
        if (!nf_log_dir_header)
                return -ENOMEM;
index 4ed149e265bf93895254bb8670c8523c822b34dd..42f630b9a6981d4f5616db8792a76831558dede5 100644 (file)
@@ -146,15 +146,9 @@ static ctl_table nr_table[] = {
        { }
 };
 
-static struct ctl_path nr_path[] = {
-       { .procname = "net", },
-       { .procname = "netrom", },
-       { }
-};
-
 void __init nr_register_sysctl(void)
 {
-       nr_table_header = register_net_sysctl_table(&init_net, nr_path, nr_table);
+       nr_table_header = register_net_sysctl(&init_net, "net/netrom", nr_table);
 }
 
 void nr_unregister_sysctl(void)
index aa55db5f383bf6b54aaee9968960b562f35ab66b..696348fd31a11300f0346007b124cb55d8f10481 100644 (file)
@@ -98,15 +98,9 @@ static struct ctl_table phonet_table[] = {
        { }
 };
 
-static struct ctl_path phonet_ctl_path[] = {
-       { .procname = "net", },
-       { .procname = "phonet", },
-       { },
-};
-
 int __init phonet_sysctl_init(void)
 {
-       phonet_table_hrd = register_net_sysctl_table(&init_net, phonet_ctl_path, phonet_table);
+       phonet_table_hrd = register_net_sysctl(&init_net, "net/phonet", phonet_table);
        return phonet_table_hrd == NULL ? -ENOMEM : 0;
 }
 
index 0fef3e15777b5396e994dc886ba542e6fbe6c81d..7e643bafb4afce715c00b0628868ffed71060431 100644 (file)
@@ -106,13 +106,6 @@ static ctl_table rds_ib_sysctl_table[] = {
        { }
 };
 
-static struct ctl_path rds_ib_sysctl_path[] = {
-       { .procname = "net", },
-       { .procname = "rds", },
-       { .procname = "ib", },
-       { }
-};
-
 void rds_ib_sysctl_exit(void)
 {
        if (rds_ib_sysctl_hdr)
@@ -121,7 +114,7 @@ void rds_ib_sysctl_exit(void)
 
 int rds_ib_sysctl_init(void)
 {
-       rds_ib_sysctl_hdr = register_net_sysctl_table(&init_net, rds_ib_sysctl_path, rds_ib_sysctl_table);
+       rds_ib_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/ib", rds_ib_sysctl_table);
        if (!rds_ib_sysctl_hdr)
                return -ENOMEM;
        return 0;
index bcfe36dc55a732805ec731eb3d4d565929dc4767..5d5ebd576f3f65bcd3c399a43b99f92f5e99f5d3 100644 (file)
@@ -109,13 +109,6 @@ static ctl_table rds_iw_sysctl_table[] = {
        { }
 };
 
-static struct ctl_path rds_iw_sysctl_path[] = {
-       { .procname = "net", },
-       { .procname = "rds", },
-       { .procname = "iw", },
-       { }
-};
-
 void rds_iw_sysctl_exit(void)
 {
        if (rds_iw_sysctl_hdr)
@@ -124,7 +117,7 @@ void rds_iw_sysctl_exit(void)
 
 int rds_iw_sysctl_init(void)
 {
-       rds_iw_sysctl_hdr = register_net_sysctl_table(&init_net, rds_iw_sysctl_path, rds_iw_sysctl_table);
+       rds_iw_sysctl_hdr = register_net_sysctl(&init_net, "net/rds/iw", rds_iw_sysctl_table);
        if (!rds_iw_sysctl_hdr)
                return -ENOMEM;
        return 0;
index 30354b8cd5848c364badb8f716088c9d0eff49e9..907214b4c4d071444dbb67ae3cb4559fe3a8267a 100644 (file)
@@ -92,13 +92,6 @@ static ctl_table rds_sysctl_rds_table[] = {
        { }
 };
 
-static struct ctl_path rds_sysctl_path[] = {
-       { .procname = "net", },
-       { .procname = "rds", },
-       { }
-};
-
-
 void rds_sysctl_exit(void)
 {
        if (rds_sysctl_reg_table)
@@ -110,7 +103,7 @@ int rds_sysctl_init(void)
        rds_sysctl_reconnect_min = msecs_to_jiffies(1);
        rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min;
 
-       rds_sysctl_reg_table = register_net_sysctl_table(&init_net, rds_sysctl_path, rds_sysctl_rds_table);
+       rds_sysctl_reg_table = register_net_sysctl(&init_net,"net/rds", rds_sysctl_rds_table);
        if (!rds_sysctl_reg_table)
                return -ENOMEM;
        return 0;
index 02b73979535bb08fa723d4b2c2940e1d2031a7a7..94ca9c2ccd692d2a278615221d60abc0ed3037ef 100644 (file)
@@ -118,15 +118,9 @@ static ctl_table rose_table[] = {
        { }
 };
 
-static struct ctl_path rose_path[] = {
-       { .procname = "net", },
-       { .procname = "rose", },
-       { }
-};
-
 void __init rose_register_sysctl(void)
 {
-       rose_table_header = register_net_sysctl_table(&init_net, rose_path, rose_table);
+       rose_table_header = register_net_sysctl(&init_net, "net/rose", rose_table);
 }
 
 void rose_unregister_sysctl(void)
index 1e385b452047eaa30c68f37c575dd38765ecb8d2..e5fe639c89e7f748885af7725acdc8663d6e9286 100644 (file)
@@ -275,18 +275,12 @@ static ctl_table sctp_table[] = {
        { /* sentinel */ }
 };
 
-static struct ctl_path sctp_path[] = {
-       { .procname = "net", },
-       { .procname = "sctp", },
-       { }
-};
-
 static struct ctl_table_header * sctp_sysctl_header;
 
 /* Sysctl registration.  */
 void sctp_sysctl_register(void)
 {
-       sctp_sysctl_header = register_net_sysctl_table(&init_net, sctp_path, sctp_table);
+       sctp_sysctl_header = register_net_sysctl(&init_net, "net/sctp", sctp_table);
 }
 
 /* Sysctl deregistration.  */
index 4f6979c06f84288532a969b6236266aa13cce26d..b34b5b9792f0eb7dd677525b543082d4f521115f 100644 (file)
@@ -26,12 +26,6 @@ static ctl_table unix_table[] = {
        { }
 };
 
-static struct ctl_path unix_path[] = {
-       { .procname = "net", },
-       { .procname = "unix", },
-       { },
-};
-
 int __net_init unix_sysctl_register(struct net *net)
 {
        struct ctl_table *table;
@@ -41,7 +35,7 @@ int __net_init unix_sysctl_register(struct net *net)
                goto err_alloc;
 
        table[0].data = &net->unx.sysctl_max_dgram_qlen;
-       net->unx.ctl = register_net_sysctl_table(net, unix_path, table);
+       net->unx.ctl = register_net_sysctl(net, "net/unix", table);
        if (net->unx.ctl == NULL)
                goto err_reg;
 
index 08337cb488d4120b1cec01c3991d2f8764fe85dc..43239527a2058007242bd32ae4bf1891f6622252 100644 (file)
@@ -73,15 +73,9 @@ static struct ctl_table x25_table[] = {
        { 0, },
 };
 
-static struct ctl_path x25_path[] = {
-       { .procname = "net", },
-       { .procname = "x25", },
-       { }
-};
-
 void __init x25_register_sysctl(void)
 {
-       x25_table_header = register_net_sysctl_table(&init_net, x25_path, x25_table);
+       x25_table_header = register_net_sysctl(&init_net, "net/x25", x25_table);
 }
 
 void x25_unregister_sysctl(void)
index 05640bc9594b7b5dc61b6e0dcd3b850e993af582..380976f74c4c90f0159c11740be35dc40602c6c6 100644 (file)
@@ -54,7 +54,7 @@ int __net_init xfrm_sysctl_init(struct net *net)
        table[2].data = &net->xfrm.sysctl_larval_drop;
        table[3].data = &net->xfrm.sysctl_acq_expires;
 
-       net->xfrm.sysctl_hdr = register_net_sysctl_table(net, net_core_path, table);
+       net->xfrm.sysctl_hdr = register_net_sysctl(net, "net/core", table);
        if (!net->xfrm.sysctl_hdr)
                goto out_register;
        return 0;