From: Tejun Heo Date: Wed, 13 Mar 2013 21:59:37 +0000 (-0700) Subject: nfsd: convert to idr_alloc() X-Git-Tag: v3.9-rc3~16^2~12 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ebd6c70714f5eda9cd1b60d23754ffd1d62481f6;p=~emulex%2Finfiniband.git 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 Acked-by: J. Bruce Fields Tested-by: J. Bruce Fields Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d91d6dbf698..2e27430b907 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;