Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359342
b: refs/heads/master
c: ac1d682
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 794e58c commit 16bb433
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 3b069c5d857a5f1b8cb6bb74c70d9446089f5077
refs/heads/master: ac1d68296b2504cd878e328be21eebb6093b7f27
19 changes: 11 additions & 8 deletions trunk/drivers/infiniband/hw/amso1100/c2_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,17 @@ static int c2_alloc_qpn(struct c2_dev *c2dev, struct c2_qp *qp)
{
int ret;

do {
spin_lock_irq(&c2dev->qp_table.lock);
ret = idr_get_new_above(&c2dev->qp_table.idr, qp,
c2dev->qp_table.last++, &qp->qpn);
spin_unlock_irq(&c2dev->qp_table.lock);
} while ((ret == -EAGAIN) &&
idr_pre_get(&c2dev->qp_table.idr, GFP_KERNEL));
return ret;
idr_preload(GFP_KERNEL);
spin_lock_irq(&c2dev->qp_table.lock);

ret = idr_alloc(&c2dev->qp_table.idr, qp, c2dev->qp_table.last++, 0,
GFP_NOWAIT);
if (ret >= 0)
qp->qpn = ret;

spin_unlock_irq(&c2dev->qp_table.lock);
idr_preload_end();
return ret < 0 ? ret : 0;
}

static void c2_free_qpn(struct c2_dev *c2dev, int qpn)
Expand Down

0 comments on commit 16bb433

Please sign in to comment.