ext4: Fix return value of ext4_split_unwritten_extents() to fix direct I/O
[safe/jmp/linux-2.6] / fs / afs / netdevices.c
index fc27d4b..7ad3650 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/inetdevice.h>
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
+#include <net/net_namespace.h>
 #include "internal.h"
 
 /*
@@ -19,11 +20,10 @@ int afs_get_MAC_address(u8 *mac, size_t maclen)
        struct net_device *dev;
        int ret = -ENODEV;
 
-       if (maclen != ETH_ALEN)
-               BUG();
+       BUG_ON(maclen != ETH_ALEN);
 
        rtnl_lock();
-       dev = __dev_getfirstbyhwtype(ARPHRD_ETHER);
+       dev = __dev_getfirstbyhwtype(&init_net, ARPHRD_ETHER);
        if (dev) {
                memcpy(mac, dev->dev_addr, maclen);
                ret = 0;
@@ -47,7 +47,7 @@ int afs_get_ipv4_interfaces(struct afs_interface *bufs, size_t maxbufs,
        ASSERT(maxbufs > 0);
 
        rtnl_lock();
-       for_each_netdev(dev) {
+       for_each_netdev(&init_net, dev) {
                if (dev->type == ARPHRD_LOOPBACK && !wantloopback)
                        continue;
                idev = __in_dev_get_rtnl(dev);