[v2] batman-adv: orig_hash_find() manages rcu_lock/unlock internally

Message ID 1302944483-4386-1-git-send-email-ordex@autistici.org (mailing list archive)
State Superseded, archived
Headers

Commit Message

Antonio Quartulli April 16, 2011, 9:01 a.m. UTC
  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>
---
 routing.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
  

Patch

diff --git a/routing.c b/routing.c
index f6c6422..634a44d 100644
--- a/routing.c
+++ b/routing.c
@@ -1310,14 +1310,11 @@  int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
 	}
 
 	/* get routing information */
-	rcu_read_lock();
 	orig_node = orig_hash_find(bat_priv, unicast_packet->dest);
 
 	if (!orig_node)
 		goto unlock;
 
-	rcu_read_unlock();
-
 	/* find_router() increases neigh_nodes refcount if found. */
 	neigh_node = find_router(bat_priv, orig_node, recv_if);
 
@@ -1464,14 +1461,11 @@  int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
 	if (bcast_packet->ttl < 2)
 		goto out;
 
-	rcu_read_lock();
 	orig_node = orig_hash_find(bat_priv, bcast_packet->orig);
 
 	if (!orig_node)
 		goto rcu_unlock;
 
-	rcu_read_unlock();
-
 	spin_lock_bh(&orig_node->bcast_seqno_lock);
 
 	/* check whether the packet is a duplicate */