aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-01-24 20:04:49 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:28 -0500
commit36f0bebd9865dc7e327777fca34b75e65cbfd1a6 (patch)
tree394626193facaaa5dd86e284617c74fb6c8a0494
parent3e37c3f9978839d91188e4ca0cc662a7245f28e4 (diff)
[TR]: Use ctl paths to register net/token-ring/ table
The same thing for token-ring - use ctl paths and get rid of external references on the tr_table. Unfortunately, I couldn't split this patch into cleanup and use-the-paths parts. As a lame excuse I can say, that the cleanup is just moving the tr_table from one file to another - closet to a single variable, that this ctl table tunes. Since the source file becomes empty after the move, I remove it. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/if_tr.h3
-rw-r--r--net/802/Makefile3
-rw-r--r--net/802/sysctl_net_802.c33
-rw-r--r--net/802/tr.c25
-rw-r--r--net/sysctl_net.c8
5 files changed, 25 insertions, 47 deletions
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index 046e9d95ba9a..5bcec8b2c5e2 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -49,9 +49,6 @@ static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
49{ 49{
50 return (struct trh_hdr *)skb_mac_header(skb); 50 return (struct trh_hdr *)skb_mac_header(skb);
51} 51}
52#ifdef CONFIG_SYSCTL
53extern struct ctl_table tr_table[];
54#endif
55#endif 52#endif
56 53
57/* This is an Token-Ring LLC structure */ 54/* This is an Token-Ring LLC structure */
diff --git a/net/802/Makefile b/net/802/Makefile
index 977704a54f68..68569ffddea1 100644
--- a/net/802/Makefile
+++ b/net/802/Makefile
@@ -3,9 +3,8 @@
3# 3#
4 4
5# Check the p8022 selections against net/core/Makefile. 5# Check the p8022 selections against net/core/Makefile.
6obj-$(CONFIG_SYSCTL) += sysctl_net_802.o
7obj-$(CONFIG_LLC) += p8022.o psnap.o 6obj-$(CONFIG_LLC) += p8022.o psnap.o
8obj-$(CONFIG_TR) += p8022.o psnap.o tr.o sysctl_net_802.o 7obj-$(CONFIG_TR) += p8022.o psnap.o tr.o
9obj-$(CONFIG_NET_FC) += fc.o 8obj-$(CONFIG_NET_FC) += fc.o
10obj-$(CONFIG_FDDI) += fddi.o 9obj-$(CONFIG_FDDI) += fddi.o
11obj-$(CONFIG_HIPPI) += hippi.o 10obj-$(CONFIG_HIPPI) += hippi.o
diff --git a/net/802/sysctl_net_802.c b/net/802/sysctl_net_802.c
deleted file mode 100644
index ead56037398b..000000000000
--- a/net/802/sysctl_net_802.c
+++ /dev/null
@@ -1,33 +0,0 @@
1/* -*- linux-c -*-
2 * sysctl_net_802.c: sysctl interface to net 802 subsystem.
3 *
4 * Begun April 1, 1996, Mike Shaver.
5 * Added /proc/sys/net/802 directory entry (empty =) ). [MS]
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <linux/mm.h>
14#include <linux/if_tr.h>
15#include <linux/sysctl.h>
16
17#ifdef CONFIG_TR
18extern int sysctl_tr_rif_timeout;
19#endif
20
21struct ctl_table tr_table[] = {
22#ifdef CONFIG_TR
23 {
24 .ctl_name = NET_TR_RIF_TIMEOUT,
25 .procname = "rif_timeout",
26 .data = &sysctl_tr_rif_timeout,
27 .maxlen = sizeof(int),
28 .mode = 0644,
29 .proc_handler = &proc_dointvec
30 },
31#endif /* CONFIG_TR */
32 { 0 },
33};
diff --git a/net/802/tr.c b/net/802/tr.c
index 151855dd4599..3f16b1720554 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -35,6 +35,7 @@
35#include <linux/proc_fs.h> 35#include <linux/proc_fs.h>
36#include <linux/seq_file.h> 36#include <linux/seq_file.h>
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/sysctl.h>
38#include <net/arp.h> 39#include <net/arp.h>
39#include <net/net_namespace.h> 40#include <net/net_namespace.h>
40 41
@@ -634,6 +635,26 @@ struct net_device *alloc_trdev(int sizeof_priv)
634 return alloc_netdev(sizeof_priv, "tr%d", tr_setup); 635 return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
635} 636}
636 637
638#ifdef CONFIG_SYSCTL
639static struct ctl_table tr_table[] = {
640 {
641 .ctl_name = NET_TR_RIF_TIMEOUT,
642 .procname = "rif_timeout",
643 .data = &sysctl_tr_rif_timeout,
644 .maxlen = sizeof(int),
645 .mode = 0644,
646 .proc_handler = &proc_dointvec
647 },
648 { 0 },
649};
650
651static __initdata struct ctl_path tr_path[] = {
652 { .procname = "net", .ctl_name = CTL_NET, },
653 { .procname = "token-ring", .ctl_name = NET_TR, },
654 { }
655};
656#endif
657
637/* 658/*
638 * Called during bootup. We don't actually have to initialise 659 * Called during bootup. We don't actually have to initialise
639 * too much for this. 660 * too much for this.
@@ -644,7 +665,9 @@ static int __init rif_init(void)
644 rif_timer.expires = jiffies + sysctl_tr_rif_timeout; 665 rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
645 setup_timer(&rif_timer, rif_check_expire, 0); 666 setup_timer(&rif_timer, rif_check_expire, 0);
646 add_timer(&rif_timer); 667 add_timer(&rif_timer);
647 668#ifdef CONFIG_SYSCTL
669 register_sysctl_paths(tr_path, tr_table);
670#endif
648 proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops); 671 proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
649 return 0; 672 return 0;
650} 673}
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index a4f0ed8d0e79..16ad14b5d572 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -31,14 +31,6 @@
31#endif 31#endif
32 32
33struct ctl_table net_table[] = { 33struct ctl_table net_table[] = {
34#ifdef CONFIG_TR
35 {
36 .ctl_name = NET_TR,
37 .procname = "token-ring",
38 .mode = 0555,
39 .child = tr_table,
40 },
41#endif
42 { 0 }, 34 { 0 },
43}; 35};
44 36