Skip to content

Commit

Permalink
null_blk: Remove usage of the deprecated ida_simple_xx() API
Browse files Browse the repository at this point in the history
[ Upstream commit 95931a2 ]

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 <[email protected]>
Link: https://lore.kernel.org/r/bf257b1078475a415cdc3344c6a750842946e367.1705222845.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jens Axboe <[email protected]>
(cherry picked from commit 95931a2)
[Harshit: backport to 6.6.y]
Signed-off-by: Harshit Mogalapalli <[email protected]>
Signed-off-by: Vegard Nossum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tititiou36 authored and gregkh committed Oct 10, 2024
1 parent 2deb10a commit b2b0220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/null_blk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ static void null_del_dev(struct nullb *nullb)

dev = nullb->dev;

ida_simple_remove(&nullb_indexes, nullb->index);
ida_free(&nullb_indexes, nullb->index);

list_del_init(&nullb->list);

Expand Down Expand Up @@ -2154,7 +2154,7 @@ static int null_add_dev(struct nullb_device *dev)
blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);

mutex_lock(&lock);
rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
rv = ida_alloc(&nullb_indexes, GFP_KERNEL);
if (rv < 0) {
mutex_unlock(&lock);
goto out_cleanup_zone;
Expand Down

0 comments on commit b2b0220

Please sign in to comment.