null_blk: Remove usage of the deprecated ida_simple_xx() API

[ Upstream commit 95931a245b ]

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/bf257b1078475a415cdc3344c6a750842946e367.1705222845.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 95931a245b)
[Harshit: backport to 6.6.y]
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christophe JAILLET 2024-10-02 17:12:34 +02:00 committed by Greg Kroah-Hartman
parent 2deb10a996
commit b2b02202f8

View File

@ -1819,7 +1819,7 @@ static void null_del_dev(struct nullb *nullb)
dev = nullb->dev; dev = nullb->dev;
ida_simple_remove(&nullb_indexes, nullb->index); ida_free(&nullb_indexes, nullb->index);
list_del_init(&nullb->list); list_del_init(&nullb->list);
@ -2154,7 +2154,7 @@ static int null_add_dev(struct nullb_device *dev)
blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q); blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);
mutex_lock(&lock); mutex_lock(&lock);
rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL); rv = ida_alloc(&nullb_indexes, GFP_KERNEL);
if (rv < 0) { if (rv < 0) {
mutex_unlock(&lock); mutex_unlock(&lock);
goto out_cleanup_zone; goto out_cleanup_zone;