From: Eric Dumazet Date: Wed, 4 Nov 2009 13:23:31 +0000 (-0800) Subject: em_meta: avoid one dev_put() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0075634cf9d288988f57392a1f132d2053af961;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git em_meta: avoid one dev_put() Another rcu conversion to avoid one dev_hold()/dev_put() pair Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 18d85d259104..8e8d836f00c0 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -303,17 +303,17 @@ META_COLLECTOR(var_sk_bound_if) { SKIP_NONLOCAL(skb); - if (skb->sk->sk_bound_dev_if == 0) { + if (skb->sk->sk_bound_dev_if == 0) { dst->value = (unsigned long) "any"; dst->len = 3; - } else { + } else { struct net_device *dev; - dev = dev_get_by_index(&init_net, skb->sk->sk_bound_dev_if); + rcu_read_lock(); + dev = dev_get_by_index_rcu(&init_net, skb->sk->sk_bound_dev_if); *err = var_dev(dev, dst); - if (dev) - dev_put(dev); - } + rcu_read_unlock(); + } } META_COLLECTOR(int_sk_refcnt)