aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/net-sysfs.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-05-17 00:59:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 12:37:32 -0400
commitd6523ddf2376f39eaa89a4d68a33052d20c138b9 (patch)
tree8ab1d869e20e06be0c1e081d717f33f41d3502ca /net/core/net-sysfs.c
parent608b4b9548dedf4185ca47edcaae4bff2ceb62de (diff)
net/sysfs: Fix the bitrot in network device kobject namespace support
I had a couple of stupid bugs in: netns: Teach network device kobjects which namespace they are in. - I duplicated the Kconfig for the NET_NS - The build was broken when sysfs was not compiled in The sysfs breakage is because after I moved the operations for the sysfs to the kobject layer, to make things cleaner I forgot to move the ifdefs. Opps. I'm not quite certain how I got introduced a second NET_NS Kconfig, but it was probably a 3 way merge somewhere along the way that did not notice that the NET_NS Kconfig option had mvoed and thout that was a bug. It probably slipped in because it used to be the sysfs patches were the first patches in my network namespace patches. Some things just don't go like you would expect. Neither of these bugs actually affect anything in the common case but they should be fixed. Thanks to Serge for noticing they were present. Reported-by: Serge E. Hallyn <serue@us.ibm.com> Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r--net/core/net-sysfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index b388cdab9316..6881e65944c8 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -469,6 +469,7 @@ static struct attribute_group wireless_group = {
469 .attrs = wireless_attrs, 469 .attrs = wireless_attrs,
470}; 470};
471#endif 471#endif
472#endif /* CONFIG_SYSFS */
472 473
473#ifdef CONFIG_RPS 474#ifdef CONFIG_RPS
474/* 475/*
@@ -796,11 +797,10 @@ static void net_kobj_ns_exit(struct net *net)
796 kobj_ns_exit(KOBJ_NS_TYPE_NET, net); 797 kobj_ns_exit(KOBJ_NS_TYPE_NET, net);
797} 798}
798 799
799static struct pernet_operations sysfs_net_ops = { 800static struct pernet_operations kobj_net_ops = {
800 .exit = net_kobj_ns_exit, 801 .exit = net_kobj_ns_exit,
801}; 802};
802 803
803#endif /* CONFIG_SYSFS */
804 804
805#ifdef CONFIG_HOTPLUG 805#ifdef CONFIG_HOTPLUG
806static int netdev_uevent(struct device *d, struct kobj_uevent_env *env) 806static int netdev_uevent(struct device *d, struct kobj_uevent_env *env)
@@ -948,8 +948,6 @@ void netdev_initialize_kobject(struct net_device *net)
948int netdev_kobject_init(void) 948int netdev_kobject_init(void)
949{ 949{
950 kobj_ns_type_register(&net_ns_type_operations); 950 kobj_ns_type_register(&net_ns_type_operations);
951#ifdef CONFIG_SYSFS 951 register_pernet_subsys(&kobj_net_ops);
952 register_pernet_subsys(&sysfs_net_ops);
953#endif
954 return class_register(&net_class); 952 return class_register(&net_class);
955} 953}