Linux block layer
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-block@vger.kernel.org>
Cc: <axboe@kernel.dk>, <kch@nvidia.com>, <damien.lemoal@wdc.com>,
	<ming.lei@redhat.com>, <shinichiro.kawasaki@wdc.com>
Subject: [PATCH 1/1] null-blk: replace deprecated ida_simple_xxx()
Date: Wed, 9 Mar 2022 14:02:22 -0800	[thread overview]
Message-ID: <20220309220222.20931-2-kch@nvidia.com> (raw)
In-Reply-To: <20220309220222.20931-1-kch@nvidia.com>

Like various places in kernel replace deprecated ida_simple_get() and
ida_simple_remove with ida_alloc() and ida_free().

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/block/null_blk/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 05b1120e6623..e077be800606 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1724,7 +1724,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);
 
@@ -2044,7 +2044,7 @@ static int null_add_dev(struct nullb_device *dev)
 	blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, nullb->q);
 
 	mutex_lock(&lock);
-	nullb->index = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
+	nullb->index = ida_alloc(&nullb_indexes, GFP_KERNEL);
 	dev->index = nullb->index;
 	mutex_unlock(&lock);
 
-- 
2.29.0


  reply	other threads:[~2022-03-09 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 22:02 [PATCH 0/1] null_blk: replace ida_simple_xxx() Chaitanya Kulkarni
2022-03-09 22:02 ` Chaitanya Kulkarni [this message]
2022-03-09 23:38   ` [PATCH 1/1] null-blk: replace deprecated ida_simple_xxx() Damien Le Moal
2022-03-10  1:57     ` Chaitanya Kulkarni
2022-03-10  2:02       ` Chaitanya Kulkarni
2022-03-10  2:15         ` Damien Le Moal
2022-03-14 23:19           ` Chaitanya Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220309220222.20931-2-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=shinichiro.kawasaki@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox