Commit 19a101a0 authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds
Browse files

net/9p: convert to idr_alloc()

Convert to the much saner new idr interface.
Signed-off-by: default avatarTejun Heo <>
Cc: Eric Van Hensbergen <>
Cc: Ron Minnich <>
Cc: Latchesar Ionkov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent ee94d523
......@@ -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;
if (idr_pre_get(&p->pool, GFP_NOFS) == 0)
return -1;
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);
if (i < 0)
return -1;
p9_debug(P9_DEBUG_MUX, " id %d pool %p\n", i, p);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment