net: Implement for_each_netdev_reverse.
authorEric W. Biederman <ebiederm@xmission.com>
Sun, 29 Nov 2009 22:25:26 +0000 (22:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Dec 2009 00:15:50 +0000 (16:15 -0800)
I will need this shortly to implement network namespace shutdown
batching.  For sanity sake network devices should be removed in
the reverse order they were created in.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h

index 9428793775a022ca6ba9b194bac1ee827e08557c..daf13d367498b1da0d03b1c243ac62d2154638fe 100644 (file)
@@ -1112,6 +1112,8 @@ extern rwlock_t                           dev_base_lock;          /* Device list lock */
 
 #define for_each_netdev(net, d)                \
                list_for_each_entry(d, &(net)->dev_base_head, dev_list)
+#define for_each_netdev_reverse(net, d)        \
+               list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_rcu(net, d)            \
                list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_safe(net, d, n)        \