idr_get_new*() and friends are about to be deprecated. Convert to the new idr_alloc() interface.
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -457,11 +457,12 @@ static int worker_pool_assign_id(struct worker_pool *pool) · 456 unmodified lines | |||
| 457 | int ret; | 457 | int ret; |
| 458 | 458 | ||
| 459 | mutex_lock(&worker_pool_idr_mutex); | 459 | mutex_lock(&worker_pool_idr_mutex); |
| 460 | idr_pre_get(&worker_pool_idr, GFP_KERNEL); | 460 | ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL); |
| 461 | ret = idr_get_new(&worker_pool_idr, pool, &pool->id); | 461 | if (ret >= 0) |
| 462 | pool->id = ret; | ||
| 462 | mutex_unlock(&worker_pool_idr_mutex); | 463 | mutex_unlock(&worker_pool_idr_mutex); |
| 463 | 464 | ||
| 464 | return ret; | 465 | return ret < 0 ? ret : 0; |
| 465 | } | 466 | } |
| 466 | 467 | ||
| 467 | /* | 468 | /* |