[NET]: Make the device list and device lookups per namespace.
[deliverable/linux.git] / drivers / block / aoe / aoecmd.c
index 1a6aeac5a1c3b55d7cece59efadf571afc6c2fa2..30394f78cac2bd7928cc1f8b26d662c668f354d1 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/genhd.h>
+#include <net/net_namespace.h>
 #include <asm/unaligned.h>
 #include "aoe.h"
 
@@ -194,15 +195,15 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
        sl = sl_tail = NULL;
 
        read_lock(&dev_base_lock);
-       for (ifp = dev_base; ifp; dev_put(ifp), ifp = ifp->next) {
+       for_each_netdev(&init_net, ifp) {
                dev_hold(ifp);
                if (!is_aoe_netif(ifp))
-                       continue;
+                       goto cont;
 
                skb = new_skb(sizeof *h + sizeof *ch);
                if (skb == NULL) {
                        printk(KERN_INFO "aoe: skb alloc failure\n");
-                       continue;
+                       goto cont;
                }
                skb_put(skb, sizeof *h + sizeof *ch);
                skb->dev = ifp;
@@ -221,6 +222,8 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
 
                skb->next = sl;
                sl = skb;
+cont:
+               dev_put(ifp);
        }
        read_unlock(&dev_base_lock);
 
This page took 0.029995 seconds and 5 git commands to generate.