@@ -38,7 +38,6 @@
#include <linux/ctype.h>
#include <linux/blkdev.h>
#include <linux/workqueue.h>
-#include <linux/rcupdate.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/hardware.h>
@@ -355,22 +354,29 @@ static __inline__ int led_get_net_activity(void)
int retval;
rx_total = tx_total = 0;
-
- /* we are running as a workqueue task, so we can use an RCU lookup */
- rcu_read_lock();
- for_each_netdev_rcu(&init_net, dev) {
- const struct rtnl_link_stats64 *stats;
- struct rtnl_link_stats64 temp;
- struct in_device *in_dev = __in_dev_get_rcu(dev);
- if (!in_dev || !in_dev->ifa_list)
- continue;
- if (ipv4_is_loopback(in_dev->ifa_list->ifa_local))
- continue;
- stats = dev_get_stats(dev, &temp);
- rx_total += stats->rx_packets;
- tx_total += stats->tx_packets;
+
+ /* we are running as a workqueue task, so we can sleep */
+ netif_lists_lock(&init_net);
+
+ for_each_netdev(&init_net, dev) {
+ struct in_device *in_dev = in_dev_get(dev);
+ const struct rtnl_link_stats64 *stats;
+ struct rtnl_link_stats64 temp;
+
+ if (!in_dev || !in_dev->ifa_list ||
+ ipv4_is_loopback(in_dev->ifa_list->ifa_local)) {
+ in_dev_put(in_dev);
+ continue;
+ }
+
+ in_dev_put(in_dev);
+
+ stats = dev_get_stats(dev, &temp);
+ rx_total += stats->rx_packets;
+ tx_total += stats->tx_packets;
}
- rcu_read_unlock();
+
+ netif_lists_unlock(&init_net);
retval = 0;