From: Tejun Heo <tj@kernel.org>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, bfields@fieldses.org,
jackm@dev.mellanox.co.il, ogerlitz@mellanox.com,
roland@purestorage.com, dan.magenheimer@oracle.com,
gregkh@linuxfoundation.org, vjaquez@igalia.com,
rene.sapiens@ti.com, x0095078@ti.com, omar.ramirez@ti.com,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 3/7] workqueue: convert to idr_alloc()
Date: Tue, 5 Mar 2013 12:02:48 -0800 [thread overview]
Message-ID: <1362513772-15174-4-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1362513772-15174-1-git-send-email-tj@kernel.org>
idr_get_new*() and friends are about to be deprecated. Convert to the
new idr_alloc() interface.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/workqueue.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 81f2457..55fac5b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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;
}
/*
--
1.8.1.4
next prev parent reply other threads:[~2013-03-05 20:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 20:02 [PATCHSET 3.9-rc1] idr: final idr_alloc() conversions and deprecation of old interface Tejun Heo
2013-03-05 20:02 ` [PATCH 1/7] nfsd: remove unused get_new_stid() Tejun Heo
2013-03-05 20:05 ` J. Bruce Fields
2013-03-05 20:02 ` [PATCH 2/7] nfsd: convert to idr_alloc() Tejun Heo
2013-03-05 22:31 ` J. Bruce Fields
2013-03-05 20:02 ` Tejun Heo [this message]
2013-03-05 20:02 ` [PATCH 4/7] mlx4: remove leftover idr_pre_get() call Tejun Heo
2013-03-05 20:02 ` [PATCH 5/7] zcache: convert to idr_alloc() Tejun Heo
2013-03-05 21:37 ` Greg KH
2013-03-05 20:02 ` [PATCH 6/7] tidspbridge: " Tejun Heo
2013-03-05 21:37 ` Greg KH
2013-03-05 20:02 ` [PATCH 7/7] idr: deprecate idr_pre_get() and idr_get_new[_above]() Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362513772-15174-4-git-send-email-tj@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bfields@fieldses.org \
--cc=dan.magenheimer@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jackm@dev.mellanox.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=omar.ramirez@ti.com \
--cc=rene.sapiens@ti.com \
--cc=roland@purestorage.com \
--cc=vjaquez@igalia.com \
--cc=x0095078@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox