diff options
author | stephen hemminger <shemminger@vyatta.com> | 2009-11-10 10:54:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-11 09:26:31 +0300 |
commit | e576b9ef41c2c1b13e0c123b6e9d0589723c68bf (patch) | |
tree | cf0873d69e78d633e1fdadef4b66f61e2341b993 /arch/s390/appldata | |
parent | f1e9016da6d0f16551d90085758ae45d26826118 (diff) | |
download | linux-e576b9ef41c2c1b13e0c123b6e9d0589723c68bf.tar.xz |
s390: use RCU to walk list of network devices
This is similar to other cases where for_each_netdev_rcu
can be used when gathering information.
By inspection, don't have platform or cross-build environment
to validate.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/s390/appldata')
-rw-r--r-- | arch/s390/appldata/appldata_net_sum.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index fa741f84c5b9..4ce7fa95880f 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c @@ -83,8 +83,9 @@ static void appldata_get_net_sum_data(void *data) rx_dropped = 0; tx_dropped = 0; collisions = 0; - read_lock(&dev_base_lock); - for_each_netdev(&init_net, dev) { + + rcu_read_lock(); + for_each_netdev_rcu(&init_net, dev) { const struct net_device_stats *stats = dev_get_stats(dev); rx_packets += stats->rx_packets; @@ -98,7 +99,8 @@ static void appldata_get_net_sum_data(void *data) collisions += stats->collisions; i++; } - read_unlock(&dev_base_lock); + rcu_read_unlock(); + net_data->nr_interfaces = i; net_data->rx_packets = rx_packets; net_data->tx_packets = tx_packets; |