mirror of
https://github.com/torvalds/linux
synced 2024-10-16 16:29:20 +00:00
virtio-blk: replace ida_simple[get|remove] with ida_[alloc_range|free]
ida_simple[get|remove] are deprecated, and are just wrappers to ida_[alloc_range|free]. Replace ida_simple[get|remove] with their corresponding counterparts. No functional changes. Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Link: https://lore.kernel.org/r/20221130123001.25473-1-p.raghav@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
63f93fd6fa
commit
92a34c4617
|
@ -512,7 +512,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);
|
||||
}
|
||||
|
@ -902,8 +902,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_range(&vd_index_ida, 0,
|
||||
minor_to_index(1 << MINORBITS) - 1, GFP_KERNEL);
|
||||
if (err < 0)
|
||||
goto out;
|
||||
index = err;
|
||||
|
@ -1163,7 +1163,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue