All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <mst@redhat.com>, <jasowang@redhat.com>, <pbonzini@redhat.com>,
	<stefanha@redhat.com>
Cc: <virtualization@lists.linux-foundation.org>,
	<linux-block@vger.kernel.org>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 4/4] virtio-blk: remove deprecated ida_simple_XXX()
Date: Tue, 19 Apr 2022 21:10:53 -0700	[thread overview]
Message-ID: <20220420041053.7927-5-kch@nvidia.com> (raw)
In-Reply-To: <20220420041053.7927-1-kch@nvidia.com>

Replace deprecated ida_simple_get() and ida_simple_remove() with
ida_alloc_max() and ida_free().

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

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 74c3a48cd1e5..e05748337dd1 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -411,7 +411,7 @@ static void virtblk_free_disk(struct gendisk *disk)
 {
 	struct virtio_blk *vblk = disk->private_data;
 
-	ida_simple_remove(&vd_index_ida, vblk->index);
+	ida_free(&vd_index_ida, vblk->index);
 	mutex_destroy(&vblk->vdev_mutex);
 	kfree(vblk);
 }
@@ -720,8 +720,8 @@ static int virtblk_probe(struct virtio_device *vdev)
 		return -EINVAL;
 	}
 
-	err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
-			     GFP_KERNEL);
+	err = ida_alloc_max(&vd_index_ida, minor_to_index(1 << MINORBITS),
+			    GFP_KERNEL);
 	if (err < 0)
 		goto out;
 	index = err;
@@ -911,7 +911,7 @@ static int virtblk_probe(struct virtio_device *vdev)
 out_free_vblk:
 	kfree(vblk);
 out_free_index:
-	ida_simple_remove(&vd_index_ida, index);
+	ida_free(&vd_index_ida, index);
 out:
 	return err;
 }
-- 
2.29.0


  parent reply	other threads:[~2022-04-20  4:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  4:10 [PATCH 0/4] virtio-blk: small cleanup Chaitanya Kulkarni
2022-04-20  4:10 ` [PATCH 1/4] virtio-blk: remove additional check in fast path Chaitanya Kulkarni
2022-04-20 14:54   ` Stefan Hajnoczi
2022-04-20 14:54     ` Stefan Hajnoczi
2022-04-21 21:51     ` Chaitanya Kulkarni
2022-04-20  4:10 ` [PATCH 2/4] virtio-blk: don't add a new line Chaitanya Kulkarni
2022-04-20 15:04   ` Stefan Hajnoczi
2022-04-20 15:04     ` Stefan Hajnoczi
2022-04-21 21:52     ` Chaitanya Kulkarni
2022-04-20  4:10 ` [PATCH 3/4] virtio-blk: avoid function call in the fast path Chaitanya Kulkarni
2022-04-20 15:16   ` Stefan Hajnoczi
2022-04-20 15:16     ` Stefan Hajnoczi
2022-04-21 21:55     ` Chaitanya Kulkarni
2022-04-20  4:10 ` Chaitanya Kulkarni [this message]
2022-04-20 15:19   ` [PATCH 4/4] virtio-blk: remove deprecated ida_simple_XXX() Stefan Hajnoczi
2022-04-20 15:19     ` Stefan Hajnoczi
2022-04-21 21:56 ` [PATCH 0/4] virtio-blk: small cleanup Chaitanya Kulkarni
2022-04-22 14:56   ` Stefan Hajnoczi
2022-04-22 14:56     ` Stefan Hajnoczi
  -- strict thread matches above, loose matches on Subject: below --
2022-05-27  8:04 [PATCH 4/4] virtio-blk: remove deprecated ida_simple_XXX() Christophe JAILLET
2022-05-27 10:19 ` Michael S. Tsirkin
2022-05-27 10:19   ` Michael S. Tsirkin

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=20220420041053.7927-5-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.