diff options
author | Antonio Quartulli <ordex@autistici.org> | 2011-04-16 05:30:57 -0400 |
---|---|---|
committer | Sven Eckelmann <sven@narfation.org> | 2011-05-01 16:49:02 -0400 |
commit | b5a6f69c5ca024bea43496d517c3b7ccfdb084a6 (patch) | |
tree | d278ccaaf84525e78eba338c5d4676de467ed0cd /net/batman-adv | |
parent | af20b710479ae662829cf739b521390daa7fcbcb (diff) |
batman-adv: orig_hash_find() manages rcu_lock/unlock internally
orig_hash_find() manages rcu_lock/unlock internally and doesn't need to
be surrounded by rcu_read_lock() / rcu_read_unlock() anymore
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/routing.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index f6c642246972..2d77bd3a3e9a 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -1310,13 +1310,10 @@ int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1310 | } | 1310 | } |
1311 | 1311 | ||
1312 | /* get routing information */ | 1312 | /* get routing information */ |
1313 | rcu_read_lock(); | ||
1314 | orig_node = orig_hash_find(bat_priv, unicast_packet->dest); | 1313 | orig_node = orig_hash_find(bat_priv, unicast_packet->dest); |
1315 | 1314 | ||
1316 | if (!orig_node) | 1315 | if (!orig_node) |
1317 | goto unlock; | 1316 | goto out; |
1318 | |||
1319 | rcu_read_unlock(); | ||
1320 | 1317 | ||
1321 | /* find_router() increases neigh_nodes refcount if found. */ | 1318 | /* find_router() increases neigh_nodes refcount if found. */ |
1322 | neigh_node = find_router(bat_priv, orig_node, recv_if); | 1319 | neigh_node = find_router(bat_priv, orig_node, recv_if); |
@@ -1362,10 +1359,7 @@ int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1362 | /* route it */ | 1359 | /* route it */ |
1363 | send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); | 1360 | send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); |
1364 | ret = NET_RX_SUCCESS; | 1361 | ret = NET_RX_SUCCESS; |
1365 | goto out; | ||
1366 | 1362 | ||
1367 | unlock: | ||
1368 | rcu_read_unlock(); | ||
1369 | out: | 1363 | out: |
1370 | if (neigh_node) | 1364 | if (neigh_node) |
1371 | neigh_node_free_ref(neigh_node); | 1365 | neigh_node_free_ref(neigh_node); |
@@ -1464,13 +1458,10 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1464 | if (bcast_packet->ttl < 2) | 1458 | if (bcast_packet->ttl < 2) |
1465 | goto out; | 1459 | goto out; |
1466 | 1460 | ||
1467 | rcu_read_lock(); | ||
1468 | orig_node = orig_hash_find(bat_priv, bcast_packet->orig); | 1461 | orig_node = orig_hash_find(bat_priv, bcast_packet->orig); |
1469 | 1462 | ||
1470 | if (!orig_node) | 1463 | if (!orig_node) |
1471 | goto rcu_unlock; | 1464 | goto out; |
1472 | |||
1473 | rcu_read_unlock(); | ||
1474 | 1465 | ||
1475 | spin_lock_bh(&orig_node->bcast_seqno_lock); | 1466 | spin_lock_bh(&orig_node->bcast_seqno_lock); |
1476 | 1467 | ||
@@ -1501,9 +1492,6 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1501 | ret = NET_RX_SUCCESS; | 1492 | ret = NET_RX_SUCCESS; |
1502 | goto out; | 1493 | goto out; |
1503 | 1494 | ||
1504 | rcu_unlock: | ||
1505 | rcu_read_unlock(); | ||
1506 | goto out; | ||
1507 | spin_unlock: | 1495 | spin_unlock: |
1508 | spin_unlock_bh(&orig_node->bcast_seqno_lock); | 1496 | spin_unlock_bh(&orig_node->bcast_seqno_lock); |
1509 | out: | 1497 | out: |