Skip to content

Commit 0f70203

Browse files
Bo Liudjbw
authored andcommitted
dax: Remove usage of the deprecated ida_simple_xxx API
ida_alloc_max() makes it clear that the second argument is inclusive, and the alloc/free terminology is more idiomatic and symmetric then get/remove. Signed-off-by: Bo Liu <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Link: https://lore.kernel.org/r/[email protected] [djbw: reword changelog] Signed-off-by: Dan Williams <[email protected]>
1 parent 2e5021c commit 0f70203

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/dax/super.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static void dax_free_inode(struct inode *inode)
363363
{
364364
struct dax_device *dax_dev = to_dax_dev(inode);
365365
if (inode->i_rdev)
366-
ida_simple_remove(&dax_minor_ida, iminor(inode));
366+
ida_free(&dax_minor_ida, iminor(inode));
367367
kmem_cache_free(dax_cache, dax_dev);
368368
}
369369

@@ -445,7 +445,7 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops)
445445
if (WARN_ON_ONCE(ops && !ops->zero_page_range))
446446
return ERR_PTR(-EINVAL);
447447

448-
minor = ida_simple_get(&dax_minor_ida, 0, MINORMASK+1, GFP_KERNEL);
448+
minor = ida_alloc_max(&dax_minor_ida, MINORMASK, GFP_KERNEL);
449449
if (minor < 0)
450450
return ERR_PTR(-ENOMEM);
451451

@@ -459,7 +459,7 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops)
459459
return dax_dev;
460460

461461
err_dev:
462-
ida_simple_remove(&dax_minor_ida, minor);
462+
ida_free(&dax_minor_ida, minor);
463463
return ERR_PTR(-ENOMEM);
464464
}
465465
EXPORT_SYMBOL_GPL(alloc_dax);

0 commit comments

Comments
 (0)