Skip to content

Commit

Permalink
workqueue: convert to idr_alloc()
Browse files Browse the repository at this point in the history
idr_get_new*() and friends are about to be deprecated.  Convert to the
new idr_alloc() interface.

Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
htejun authored and torvalds committed Mar 13, 2013
1 parent ebd6c70 commit e68035f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,12 @@ static int worker_pool_assign_id(struct worker_pool *pool)
int ret;

mutex_lock(&worker_pool_idr_mutex);
idr_pre_get(&worker_pool_idr, GFP_KERNEL);
ret = idr_get_new(&worker_pool_idr, pool, &pool->id);
ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL);
if (ret >= 0)
pool->id = ret;
mutex_unlock(&worker_pool_idr_mutex);

return ret;
return ret < 0 ? ret : 0;
}

/*
Expand Down

0 comments on commit e68035f

Please sign in to comment.