Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e37c3f9978839d91188e4ca0cc662a7245f28e4
Commit:     3e37c3f9978839d91188e4ca0cc662a7245f28e4
Parent:     9ba639797606acbcd97be886f41fbce163914e7b
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 5 01:41:26 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:56:27 2008 -0800

    [IPV4]: Use ctl paths to register net/ipv4/ table
    
    This is the same as I did for the net/core/ table in the
    second patch in his series: use the paths and isolate the
    whole table in the .c file.
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/ip.h           |    2 --
 net/ipv4/sysctl_net_ipv4.c |   19 ++++++++++++++++++-
 net/sysctl_net.c           |    8 --------
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/include/net/ip.h b/include/net/ip.h
index 66d5161..17d1189 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -395,6 +395,4 @@ int ipv4_doint_and_flush_strategy(ctl_table *table, int 
__user *name, int nlen,
 extern int ip_misc_proc_init(void);
 #endif
 
-extern struct ctl_table ipv4_table[];
-
 #endif /* _IP_H */
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 3546424..bfd0dec 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -13,6 +13,7 @@
 #include <linux/igmp.h>
 #include <linux/inetdevice.h>
 #include <linux/seqlock.h>
+#include <linux/init.h>
 #include <net/snmp.h>
 #include <net/icmp.h>
 #include <net/ip.h>
@@ -247,7 +248,7 @@ static int strategy_allowed_congestion_control(ctl_table 
*table, int __user *nam
 
 }
 
-ctl_table ipv4_table[] = {
+static struct ctl_table ipv4_table[] = {
        {
                .ctl_name       = NET_IPV4_TCP_TIMESTAMPS,
                .procname       = "tcp_timestamps",
@@ -878,3 +879,19 @@ ctl_table ipv4_table[] = {
        },
        { .ctl_name = 0 }
 };
+
+static __initdata struct ctl_path net_ipv4_path[] = {
+       { .procname = "net", .ctl_name = CTL_NET, },
+       { .procname = "ipv4", .ctl_name = NET_IPV4, },
+       { },
+};
+
+static __init int sysctl_ipv4_init(void)
+{
+       struct ctl_table_header *hdr;
+
+       hdr = register_sysctl_paths(net_ipv4_path, ipv4_table);
+       return hdr == NULL ? -ENOMEM : 0;
+}
+
+__initcall(sysctl_ipv4_init);
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 747fc55..a4f0ed8 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -31,14 +31,6 @@
 #endif
 
 struct ctl_table net_table[] = {
-#ifdef CONFIG_INET
-       {
-               .ctl_name       = NET_IPV4,
-               .procname       = "ipv4",
-               .mode           = 0555,
-               .child          = ipv4_table
-       },
-#endif
 #ifdef CONFIG_TR
        {
                .ctl_name       = NET_TR,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to