login
Header Space

 
 

[PATCH 14/14][VLAN]: Migrate proc files when vlan device is moved to namespace.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Netdev List <netdev@...>
Cc: Daniel Lezcano <dlezcano@...>, Denis Lunev <den@...>, Linux Containers <containers@...>, Benjamin Thery <benjamin.thery@...>
Date: Thursday, April 10, 2008 - 11:23 am

The preparations to this are done with my patch, that fixed 
proc on vlan device rename. 

This makes /proc/net/vlan/<device> file migrate from one
proc tree to another...

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---
 net/8021q/vlan.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 7e9d22e..2a739ad 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -154,8 +154,6 @@ void unregister_vlan_dev(struct net_device *dev)
 	grp = __vlan_find_group(real_dev);
 	BUG_ON(!grp);
 
-	vlan_proc_rem_dev(dev);
-
 	/* Take it out of our own structures, but be sure to interlock with
 	 * HW accelerating devices or SW vlan input packet processing.
 	 */
@@ -278,9 +276,6 @@ int register_vlan_dev(struct net_device *dev)
 	if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
 		real_dev->vlan_rx_add_vid(real_dev, vlan_id);
 
-	if (vlan_proc_add_dev(dev) < 0)
-		pr_warning("8021q: failed to add proc entry for %s\n",
-			   dev->name);
 	return 0;
 
 out_free_group:
@@ -396,6 +391,14 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
 			pr_warning("8021q: failed to change proc name for %s\n",
 					dev->name);
 		break;
+	case NETDEV_REGISTER:
+		if (vlan_proc_add_dev(dev) < 0)
+			pr_warning("8021q: failed to add proc entry for %s\n",
+					dev->name);
+		break;
+	case NETDEV_UNREGISTER:
+		vlan_proc_rem_dev(dev);
+		break;
 	}
 }
 
-- 
1.5.3.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 14/14][VLAN]: Migrate proc files when vlan device is ..., Pavel Emelyanov, (Thu Apr 10, 11:23 am)
[PATCH 12/14][VLAN]: Make vlan_name_type per-net., Pavel Emelyanov, (Thu Apr 10, 11:20 am)
[PATCH 10/14][VLAN]: Create proc files in proper net., Pavel Emelyanov, (Thu Apr 10, 11:18 am)
[PATCH 8/14][VLAN]: Introduce the vlan_net structure., Pavel Emelyanov, (Thu Apr 10, 11:14 am)
[PATCH 7/14][VLAN]: Tag vlan_group with device, not ifindex., Pavel Emelyanov, (Thu Apr 10, 11:13 am)
[PATCH 6/14][RTNL]: Introduce the rtnl_kill_links call., Pavel Emelyanov, (Thu Apr 10, 11:10 am)
Re: [PATCH 6/14][RTNL]: Introduce the rtnl_kill_links call., Daniel Hokka Zakrisson, (Thu Apr 10, 6:09 pm)
Re: [PATCH 6/14][RTNL]: Introduce the rtnl_kill_links call., Pavel Emelyanov, (Fri Apr 11, 4:01 am)
Re: [PATCH 6/14][RTNL]: Introduce the rtnl_kill_links call., Patrick McHardy, (Fri Apr 11, 8:48 am)
[PATCH 4/14][TUN]: Actually make the tun_dev_list per-net., Pavel Emelyanov, (Thu Apr 10, 11:07 am)
[PATCH 3/14][TUN]: Introduce the tun_net structure., Pavel Emelyanov, (Thu Apr 10, 11:06 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., David Miller, (Tue Apr 15, 3:44 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Pavel Emelyanov, (Tue Apr 15, 6:31 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., David Miller, (Tue Apr 15, 6:06 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Paul E. McKenney, (Thu Apr 10, 9:01 pm)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Pavel Emelyanov, (Fri Apr 11, 3:55 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Paul E. McKenney, (Fri Apr 11, 11:04 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Pavel Emelyanov, (Fri Apr 11, 11:45 am)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Paul E. McKenney, (Fri Apr 11, 12:27 pm)
Re: [PATCH 3/14][TUN]: Introduce the tun_net structure., Pavel Emelyanov, (Sat Apr 12, 4:44 am)
[PATCH 2/14][NETNS]: Generic per-net pointers., Pavel Emelyanov, (Thu Apr 10, 11:04 am)
Re: [PATCH 2/14][NETNS]: Generic per-net pointers., Daniel Lezcano, (Fri Apr 11, 9:43 am)
Re: [PATCH 2/14][NETNS]: Generic per-net pointers., Pavel Emelyanov, (Fri Apr 11, 10:29 am)
[PATCH 1/14][NETNS]: Introduce the net-subsys id generator., Pavel Emelyanov, (Thu Apr 10, 11:01 am)
speck-geostationary