* [PATCH net-next-2.6] parisc: led: Use for_each_netdev_rcu()
@ 2009-11-10 4:07 Eric Dumazet
2009-11-11 6:35 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2009-11-10 4:07 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
Use for_each_netdev_rcu() and dont lock dev_base_lock anymore
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/parisc/led.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index 9581d36..79caf1c 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -352,11 +352,9 @@ static __inline__ int led_get_net_activity(void)
rx_total = tx_total = 0;
- /* we are running as a workqueue task, so locking dev_base
- * for reading should be OK */
- read_lock(&dev_base_lock);
+ /* we are running as a workqueue task, so we can use an RCU lookup */
rcu_read_lock();
- for_each_netdev(&init_net, dev) {
+ for_each_netdev_rcu(&init_net, dev) {
const struct net_device_stats *stats;
struct in_device *in_dev = __in_dev_get_rcu(dev);
if (!in_dev || !in_dev->ifa_list)
@@ -368,7 +366,6 @@ static __inline__ int led_get_net_activity(void)
tx_total += stats->tx_packets;
}
rcu_read_unlock();
- read_unlock(&dev_base_lock);
retval = 0;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-11 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-10 4:07 [PATCH net-next-2.6] parisc: led: Use for_each_netdev_rcu() Eric Dumazet
2009-11-11 6:35 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).