Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359343
b: refs/heads/master
c: 6fa7800
h: refs/heads/master
i:
  359341: 794e58c
  359339: bbb4dc2
  359335: fb38a63
  359327: a0d0aa6
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 16bb433 commit b3b04a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac1d68296b2504cd878e328be21eebb6093b7f27
refs/heads/master: 6fa780095f058f0960f220754217701a53a9e403
24 changes: 11 additions & 13 deletions trunk/drivers/infiniband/hw/cxgb3/iwch.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,17 @@ static inline int insert_handle(struct iwch_dev *rhp, struct idr *idr,
void *handle, u32 id)
{
int ret;
int newid;

do {
if (!idr_pre_get(idr, GFP_KERNEL)) {
return -ENOMEM;
}
spin_lock_irq(&rhp->lock);
ret = idr_get_new_above(idr, handle, id, &newid);
BUG_ON(newid != id);
spin_unlock_irq(&rhp->lock);
} while (ret == -EAGAIN);

return ret;

idr_preload(GFP_KERNEL);
spin_lock_irq(&rhp->lock);

ret = idr_alloc(idr, handle, id, id + 1, GFP_NOWAIT);

spin_unlock_irq(&rhp->lock);
idr_preload_end();

BUG_ON(ret == -ENOSPC);
return ret < 0 ? ret : 0;
}

static inline void remove_handle(struct iwch_dev *rhp, struct idr *idr, u32 id)
Expand Down

0 comments on commit b3b04a1

Please sign in to comment.