]> err.no Git - linux-2.6/blobdiff - net/8021q/vlanproc.c
[NET]: Make /proc/net per network namespace
[linux-2.6] / net / 8021q / vlanproc.c
index 8693b21b3caae070e25bbf5031fe7866ea3222b2..ac80e6b9ef5351616cf119a31cfe4379fba22d9a 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/fs.h>
 #include <linux/netdevice.h>
 #include <linux/if_vlan.h>
+#include <net/net_namespace.h>
 #include "vlanproc.h"
 #include "vlan.h"
 
@@ -69,7 +70,7 @@ static const char name_conf[]  = "config";
  *     Generic /proc/net/vlan/<file> file and inode operations
  */
 
-static struct seq_operations vlan_seq_ops = {
+static const struct seq_operations vlan_seq_ops = {
        .start = vlan_seq_start,
        .next = vlan_seq_next,
        .stop = vlan_seq_stop,
@@ -143,7 +144,7 @@ void vlan_proc_cleanup(void)
                remove_proc_entry(name_conf, proc_vlan_dir);
 
        if (proc_vlan_dir)
-               proc_net_remove(name_root);
+               proc_net_remove(&init_net, name_root);
 
        /* Dynamically added entries should be cleaned up as their vlan_device
         * is removed, so we should not have to take care of it here...
@@ -156,7 +157,7 @@ void vlan_proc_cleanup(void)
 
 int __init vlan_proc_init(void)
 {
-       proc_vlan_dir = proc_mkdir(name_root, proc_net);
+       proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net);
        if (proc_vlan_dir) {
                proc_vlan_conf = create_proc_entry(name_conf,
                                                   S_IFREG|S_IRUSR|S_IWUSR,
@@ -319,7 +320,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
        static const char fmt[] = "%30s %12lu\n";
        int i;
 
-       if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
+       if (!(vlandev->priv_flags & IFF_802_1Q_VLAN))
                return 0;
 
        seq_printf(seq, "%s  VID: %d     REORDER_HDR: %i  dev->priv_flags: %hx\n",