Skip to content

Commit ebd6c70

Browse files
htejuntorvalds
authored andcommitted
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 <[email protected]> Acked-by: J. Bruce Fields <[email protected]> Tested-by: J. Bruce Fields <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 801cb2d commit ebd6c70

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,8 @@ kmem_cache *slab)
242242
if (!stid)
243243
return NULL;
244244

245-
if (!idr_pre_get(stateids, GFP_KERNEL))
246-
goto out_free;
247-
if (idr_get_new_above(stateids, stid, min_stateid, &new_id))
245+
new_id = idr_alloc(stateids, stid, min_stateid, 0, GFP_KERNEL);
246+
if (new_id < 0)
248247
goto out_free;
249248
stid->sc_client = cl;
250249
stid->sc_type = 0;

0 commit comments

Comments
 (0)