diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-01 20:23:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-02 08:55:09 +0100 |
commit | c148fc2e30c988f7e3ac91738b2c03f1cef44849 (patch) | |
tree | 3e9e213cd4dfb554f61cea5315359b1bec330590 /net/ipv4/devinet.c | |
parent | veth: Fix unregister_netdevice_queue for veth (diff) | |
download | linux-c148fc2e30c988f7e3ac91738b2c03f1cef44849.tar.xz linux-c148fc2e30c988f7e3ac91738b2c03f1cef44849.zip |
ipv4: inetdev_by_index() switch to RCU
Use dev_get_by_index_rcu() instead of __dev_get_by_index() and
dev_base_lock rwlock
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 5df2f6a0b0f0..ccccaae50b20 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -405,11 +405,12 @@ struct in_device *inetdev_by_index(struct net *net, int ifindex) { struct net_device *dev; struct in_device *in_dev = NULL; - read_lock(&dev_base_lock); - dev = __dev_get_by_index(net, ifindex); + + rcu_read_lock(); + dev = dev_get_by_index_rcu(net, ifindex); if (dev) in_dev = in_dev_get(dev); - read_unlock(&dev_base_lock); + rcu_read_unlock(); return in_dev; } |