diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-02-18 07:28:09 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 06:52:00 -0500 |
commit | 7aadf889e897155c45cda230d2a6701ad1fbff61 (patch) | |
tree | 4a31df411c29844afe25ccde17d2ff9e618241c1 /net/batman-adv/unicast.c | |
parent | 39901e716275da4e831b40f9e45a1b61d6a776dc (diff) |
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.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index 0603ceaeef62..2d5daac52034 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, | |||
178 | (struct unicast_frag_packet *)skb->data; | 178 | (struct unicast_frag_packet *)skb->data; |
179 | 179 | ||
180 | *new_skb = NULL; | 180 | *new_skb = NULL; |
181 | |||
181 | spin_lock_bh(&bat_priv->orig_hash_lock); | 182 | spin_lock_bh(&bat_priv->orig_hash_lock); |
182 | rcu_read_lock(); | 183 | orig_node = orig_hash_find(bat_priv, unicast_packet->orig); |
183 | orig_node = ((struct orig_node *) | 184 | if (!orig_node) |
184 | hash_find(bat_priv->orig_hash, compare_orig, choose_orig, | 185 | goto unlock; |
185 | unicast_packet->orig)); | ||
186 | rcu_read_unlock(); | ||
187 | |||
188 | if (!orig_node) { | ||
189 | pr_debug("couldn't find originator in orig_hash\n"); | ||
190 | goto out; | ||
191 | } | ||
192 | 186 | ||
193 | orig_node->last_frag_packet = jiffies; | 187 | orig_node->last_frag_packet = jiffies; |
194 | 188 | ||
@@ -212,9 +206,12 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, | |||
212 | /* if not, merge failed */ | 206 | /* if not, merge failed */ |
213 | if (*new_skb) | 207 | if (*new_skb) |
214 | ret = NET_RX_SUCCESS; | 208 | ret = NET_RX_SUCCESS; |
215 | out: | ||
216 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
217 | 209 | ||
210 | unlock: | ||
211 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
212 | out: | ||
213 | if (orig_node) | ||
214 | kref_put(&orig_node->refcount, orig_node_free_ref); | ||
218 | return ret; | 215 | return ret; |
219 | } | 216 | } |
220 | 217 | ||