summaryrefslogtreecommitdiff
path: root/net/batman-adv/unicast.c
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-02-18 12:28:09 (GMT)
committerMarek Lindner <lindner_marek@yahoo.de>2011-03-05 11:52:00 (GMT)
commit7aadf889e897155c45cda230d2a6701ad1fbff61 (patch)
tree4a31df411c29844afe25ccde17d2ff9e618241c1 /net/batman-adv/unicast.c
parent39901e716275da4e831b40f9e45a1b61d6a776dc (diff)
downloadlinux-7aadf889e897155c45cda230d2a6701ad1fbff61.tar.xz
batman-adv: remove extra layer between hash and hash element - hash bucket
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r--net/batman-adv/unicast.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 0603cea..2d5daac 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -178,17 +178,11 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
(struct unicast_frag_packet *)skb->data;
*new_skb = NULL;
+
spin_lock_bh(&bat_priv->orig_hash_lock);
- rcu_read_lock();
- orig_node = ((struct orig_node *)
- hash_find(bat_priv->orig_hash, compare_orig, choose_orig,
- unicast_packet->orig));
- rcu_read_unlock();
-
- if (!orig_node) {
- pr_debug("couldn't find originator in orig_hash\n");
- goto out;
- }
+ orig_node = orig_hash_find(bat_priv, unicast_packet->orig);
+ if (!orig_node)
+ goto unlock;
orig_node->last_frag_packet = jiffies;
@@ -212,9 +206,12 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
/* if not, merge failed */
if (*new_skb)
ret = NET_RX_SUCCESS;
-out:
- spin_unlock_bh(&bat_priv->orig_hash_lock);
+unlock:
+ spin_unlock_bh(&bat_priv->orig_hash_lock);
+out:
+ if (orig_node)
+ kref_put(&orig_node->refcount, orig_node_free_ref);
return ret;
}