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>
此提交包含在:
Tejun Heo
2013-02-27 17:04:59 -08:00
提交者 Linus Torvalds
父節點 19a101a02e
當前提交 9475af6e44
共有 2 個檔案被更改,包括 4 行新增16 行删除

查看文件

@@ -2017,24 +2017,14 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
skb = skb_clone(skb, GFP_ATOMIC);
if (skb) {
unsigned long flags;
int id, r;
int id;
spin_lock_irqsave(&local->ack_status_lock, flags);
r = idr_get_new_above(&local->ack_status_frames,
orig_skb, 1, &id);
if (r == -EAGAIN) {
idr_pre_get(&local->ack_status_frames,
GFP_ATOMIC);
r = idr_get_new_above(&local->ack_status_frames,
orig_skb, 1, &id);
}
if (WARN_ON(!id) || id > 0xffff) {
idr_remove(&local->ack_status_frames, id);
r = -ERANGE;
}
id = idr_alloc(&local->ack_status_frames, orig_skb,
1, 0x10000, GFP_ATOMIC);
spin_unlock_irqrestore(&local->ack_status_lock, flags);
if (!r) {
if (id >= 0) {
info_id = id;
info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
} else if (skb_shared(skb)) {