Skip to content

Commit

Permalink
[TR]: Use ctl paths to register net/token-ring/ table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
xemul authored and davem330 committed Jan 28, 2008
1 parent 3e37c3f commit 36f0beb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 47 deletions.
3 changes: 0 additions & 3 deletions include/linux/if_tr.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
{
return (struct trh_hdr *)skb_mac_header(skb);
}
#ifdef CONFIG_SYSCTL
extern struct ctl_table tr_table[];
#endif
#endif

/* This is an Token-Ring LLC structure */
Expand Down
3 changes: 1 addition & 2 deletions net/802/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
#

# Check the p8022 selections against net/core/Makefile.
obj-$(CONFIG_SYSCTL) += sysctl_net_802.o
obj-$(CONFIG_LLC) += p8022.o psnap.o
obj-$(CONFIG_TR) += p8022.o psnap.o tr.o sysctl_net_802.o
obj-$(CONFIG_TR) += p8022.o psnap.o tr.o
obj-$(CONFIG_NET_FC) += fc.o
obj-$(CONFIG_FDDI) += fddi.o
obj-$(CONFIG_HIPPI) += hippi.o
Expand Down
33 changes: 0 additions & 33 deletions net/802/sysctl_net_802.c

This file was deleted.

25 changes: 24 additions & 1 deletion net/802/tr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/sysctl.h>
#include <net/arp.h>
#include <net/net_namespace.h>

Expand Down Expand Up @@ -634,6 +635,26 @@ struct net_device *alloc_trdev(int sizeof_priv)
return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
}

#ifdef CONFIG_SYSCTL
static struct ctl_table tr_table[] = {
{
.ctl_name = NET_TR_RIF_TIMEOUT,
.procname = "rif_timeout",
.data = &sysctl_tr_rif_timeout,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
{ 0 },
};

static __initdata struct ctl_path tr_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, },
{ .procname = "token-ring", .ctl_name = NET_TR, },
{ }
};
#endif

/*
* Called during bootup. We don't actually have to initialise
* too much for this.
Expand All @@ -644,7 +665,9 @@ static int __init rif_init(void)
rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
setup_timer(&rif_timer, rif_check_expire, 0);
add_timer(&rif_timer);

#ifdef CONFIG_SYSCTL
register_sysctl_paths(tr_path, tr_table);
#endif
proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
return 0;
}
Expand Down
8 changes: 0 additions & 8 deletions net/sysctl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@
#endif

struct ctl_table net_table[] = {
#ifdef CONFIG_TR
{
.ctl_name = NET_TR,
.procname = "token-ring",
.mode = 0555,
.child = tr_table,
},
#endif
{ 0 },
};

Expand Down

0 comments on commit 36f0beb

Please sign in to comment.