diff options
author | Tejun Heo <tj@kernel.org> | 2013-02-27 20:04:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 22:10:20 -0500 |
commit | 9475af6e44d2c17583243c253e2464467b52fa50 (patch) | |
tree | 573f01d006774828e0b39102ee31525cc5b4dbcb /net/mac80211/tx.c | |
parent | 19a101a02ec65400233459ee7cef7037dbe8f15b (diff) |
mac80211: convert to idr_alloc()
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5b9602b62405..de8548bf0a7f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -2017,24 +2017,14 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
2017 | skb = skb_clone(skb, GFP_ATOMIC); | 2017 | skb = skb_clone(skb, GFP_ATOMIC); |
2018 | if (skb) { | 2018 | if (skb) { |
2019 | unsigned long flags; | 2019 | unsigned long flags; |
2020 | int id, r; | 2020 | int id; |
2021 | 2021 | ||
2022 | spin_lock_irqsave(&local->ack_status_lock, flags); | 2022 | spin_lock_irqsave(&local->ack_status_lock, flags); |
2023 | r = idr_get_new_above(&local->ack_status_frames, | 2023 | id = idr_alloc(&local->ack_status_frames, orig_skb, |
2024 | orig_skb, 1, &id); | 2024 | 1, 0x10000, GFP_ATOMIC); |
2025 | if (r == -EAGAIN) { | ||
2026 | idr_pre_get(&local->ack_status_frames, | ||
2027 | GFP_ATOMIC); | ||
2028 | r = idr_get_new_above(&local->ack_status_frames, | ||
2029 | orig_skb, 1, &id); | ||
2030 | } | ||
2031 | if (WARN_ON(!id) || id > 0xffff) { | ||
2032 | idr_remove(&local->ack_status_frames, id); | ||
2033 | r = -ERANGE; | ||
2034 | } | ||
2035 | spin_unlock_irqrestore(&local->ack_status_lock, flags); | 2025 | spin_unlock_irqrestore(&local->ack_status_lock, flags); |
2036 | 2026 | ||
2037 | if (!r) { | 2027 | if (id >= 0) { |
2038 | info_id = id; | 2028 | info_id = id; |
2039 | info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; | 2029 | info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; |
2040 | } else if (skb_shared(skb)) { | 2030 | } else if (skb_shared(skb)) { |