Skip to content

Commit

Permalink
em_meta: avoid one dev_put()
Browse files Browse the repository at this point in the history
Another rcu conversion to avoid one dev_hold()/dev_put() pair

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 4, 2009
1 parent c707985 commit d007563
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/sched/em_meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d007563

Please sign in to comment.