summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorTejun Heo2013-03-13 22:59:37 +0100
committerLinus Torvalds2013-03-13 23:21:45 +0100
commitebd6c70714f5eda9cd1b60d23754ffd1d62481f6 (patch)
tree92c7ea47dedb25badf9dc57797acc4b99900064f /fs/nfsd/nfs4state.c
parentnfsd: remove unused get_new_stid() (diff)
downloadkernel-qcow2-linux-ebd6c70714f5eda9cd1b60d23754ffd1d62481f6.tar.gz
kernel-qcow2-linux-ebd6c70714f5eda9cd1b60d23754ffd1d62481f6.tar.xz
kernel-qcow2-linux-ebd6c70714f5eda9cd1b60d23754ffd1d62481f6.zip
nfsd: convert to idr_alloc()
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> Acked-by: J. Bruce Fields <bfields@redhat.com> Tested-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d91d6dbf698a..2e27430b9070 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;