Skip to content

Commit

Permalink
nfsd: convert to idr_alloc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Mar 13, 2013
1 parent 801cb2d commit ebd6c70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ebd6c70

Please sign in to comment.