Commit b874fb80 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Wentao Guan
Browse files

null_blk: Remove usage of the deprecated ida_simple_xx() API

stable inclusion
from stable-v6.6.55
commit 95931a245b44ee04f3359ec432e73614d44d8b38
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB0MX4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=95931a245b44ee04f3359ec432e73614d44d8b38



--------------------------------

[ Upstream commit 95931a245b44ee04f3359ec432e73614d44d8b38 ]

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/bf257b1078475a415cdc3344c6a750842946e367.1705222845.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
(cherry picked from commit 95931a245b44ee04f3359ec432e73614d44d8b38)
[Harshit: backport to 6.6.y]
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Confilct: drivers/block/null_blk/main.c ]
(cherry picked from commit b2b02202f87dd7c9a981008712f4efa3d7190ed8)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent 580eaab8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1835,7 +1835,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);

@@ -2169,7 +2169,7 @@ static int null_add_dev(struct nullb_device *dev)
	nullb->q->queuedata = nullb;
	blk_queue_flag_set(QUEUE_FLAG_NONROT, nullb->q);

	rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
	rv = ida_alloc(&nullb_indexes, GFP_KERNEL);
	if (rv < 0)
		goto out_cleanup_zone;