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>,
linux-nfs@vger.kernel.org
Subject: [PATCH 2/7] nfsd: convert to idr_alloc()
Date: Tue, 5 Mar 2013 12:02:47 -0800 [thread overview]
Message-ID: <1362513772-15174-3-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.
Only compile-tested.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org
---
fs/nfsd/nfs4state.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d91d6db..2e27430 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -242,9 +242,8 @@ kmem_cache *slab)
if (!stid)
return NULL;
- if (!idr_pre_get(stateids, GFP_KERNEL))
- goto out_free;
- if (idr_get_new_above(stateids, stid, min_stateid, &new_id))
+ new_id = idr_alloc(stateids, stid, min_stateid, 0, GFP_KERNEL);
+ if (new_id < 0)
goto out_free;
stid->sc_client = cl;
stid->sc_type = 0;
--
1.8.1.4
next prev parent reply other threads:[~2013-03-05 20:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1362513772-15174-1-git-send-email-tj@kernel.org>
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 ` Tejun Heo [this message]
2013-03-05 22:31 ` [PATCH 2/7] nfsd: convert to idr_alloc() J. Bruce Fields
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-3-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=linux-nfs@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;
as well as URLs for NNTP newsgroup(s).