Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359377
b: refs/heads/master
c: 19a101a
h: refs/heads/master
i:
  359375: edb997b
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 036a86c commit df44607
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 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: ee94d523bf92d3b8b2de166943d48ac7fd695e10
refs/heads/master: 19a101a02ec65400233459ee7cef7037dbe8f15b
17 changes: 6 additions & 11 deletions trunk/net/9p/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,18 @@ EXPORT_SYMBOL(p9_idpool_destroy);

int p9_idpool_get(struct p9_idpool *p)
{
int i = 0;
int error;
int i;
unsigned long flags;

retry:
if (idr_pre_get(&p->pool, GFP_NOFS) == 0)
return -1;

idr_preload(GFP_NOFS);
spin_lock_irqsave(&p->lock, flags);

/* no need to store exactly p, we just need something non-null */
error = idr_get_new(&p->pool, p, &i);
spin_unlock_irqrestore(&p->lock, flags);
i = idr_alloc(&p->pool, p, 0, 0, GFP_NOWAIT);

if (error == -EAGAIN)
goto retry;
else if (error)
spin_unlock_irqrestore(&p->lock, flags);
idr_preload_end();
if (i < 0)
return -1;

p9_debug(P9_DEBUG_MUX, " id %d pool %p\n", i, p);
Expand Down

0 comments on commit df44607

Please sign in to comment.