diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-04 08:23:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-04 08:23:31 -0500 |
commit | d0075634cf9d288988f57392a1f132d2053af961 (patch) | |
tree | be60c4ea0c9fc72d8d644a95be0452262c6e7941 /net/sched | |
parent | c7079857cd89cb5bc686df1d441db8ef0137abf1 (diff) |
em_meta: avoid one dev_put()
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>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/em_meta.c | 12 |
1 files changed, 6 insertions, 6 deletions
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) | |||
303 | { | 303 | { |
304 | SKIP_NONLOCAL(skb); | 304 | SKIP_NONLOCAL(skb); |
305 | 305 | ||
306 | if (skb->sk->sk_bound_dev_if == 0) { | 306 | if (skb->sk->sk_bound_dev_if == 0) { |
307 | dst->value = (unsigned long) "any"; | 307 | dst->value = (unsigned long) "any"; |
308 | dst->len = 3; | 308 | dst->len = 3; |
309 | } else { | 309 | } else { |
310 | struct net_device *dev; | 310 | struct net_device *dev; |
311 | 311 | ||
312 | dev = dev_get_by_index(&init_net, skb->sk->sk_bound_dev_if); | 312 | rcu_read_lock(); |
313 | dev = dev_get_by_index_rcu(&init_net, skb->sk->sk_bound_dev_if); | ||
313 | *err = var_dev(dev, dst); | 314 | *err = var_dev(dev, dst); |
314 | if (dev) | 315 | rcu_read_unlock(); |
315 | dev_put(dev); | 316 | } |
316 | } | ||
317 | } | 317 | } |
318 | 318 | ||
319 | META_COLLECTOR(int_sk_refcnt) | 319 | META_COLLECTOR(int_sk_refcnt) |