}
/* we can have in flight packet[s] on the cpus we are not flushing,
- * synchronize_net() in rollback_registered_many() will take care of
+ * synchronize_net() in unregister_netdevice_many() will take care of
* them
*/
for_each_cpu(cpu, &flush_cpus)
}
EXPORT_SYMBOL(synchronize_net);
-static void rollback_registered_many(struct list_head *head);
-
/**
* unregister_netdevice_queue - remove device from the kernel
* @dev: device
LIST_HEAD(single);
list_add(&dev->unreg_list, &single);
- rollback_registered_many(&single);
- list_del(&single);
+ unregister_netdevice_many(&single);
}
}
EXPORT_SYMBOL(unregister_netdevice_queue);
* we force a list_del() to make sure stack wont be corrupted later.
*/
void unregister_netdevice_many(struct list_head *head)
-{
- if (!list_empty(head)) {
- rollback_registered_many(head);
- list_del(head);
- }
-}
-EXPORT_SYMBOL(unregister_netdevice_many);
-
-static void rollback_registered_many(struct list_head *head)
{
struct net_device *dev, *tmp;
LIST_HEAD(close_head);
BUG_ON(dev_boot_phase);
ASSERT_RTNL();
+ if (list_empty(head))
+ return;
+
list_for_each_entry_safe(dev, tmp, head, unreg_list) {
/* Some devices call without registering
* for initialization unwind. Remove those
dev_put(dev);
net_set_todo(dev);
}
+
+ list_del(head);
}
+EXPORT_SYMBOL(unregister_netdevice_many);
/**
* unregister_netdev - remove device from the kernel