drivers: block: Directly use ida_alloc()/free()
PATCH 1/1 drivers: block: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .
Signed-off-by keliu <[email protected]>
--- drivers/block/null_blk/main.c | 4 ++-- drivers/block/rbd.c | 4 ++-- drivers/block/virtio_blk.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/block/null_blk/main.c +2 -2
@@ -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);
drivers/block/rbd.c +2 -2
@@ -5280,7 +5280,7 @@ static void rbd_dev_release(struct device *dev)if (need_put) {destroy_workqueue (rbd_dev->task_wq); -ida_simple_remove (&rbd_dev_id_ida, rbd_dev->dev_id); +ida_free (&rbd_dev_id_ida, rbd_dev->dev_id); }rbd_dev_free (rbd_dev);
@@ -5381,7 +5381,7 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,return rbd_dev; fail_dev_id: -ida_simple_remove (&rbd_dev_id_ida, rbd_dev->dev_id); +ida_free (&rbd_dev_id_ida, rbd_dev->dev_id); fail_rbd_dev:rbd_dev_free (rbd_dev);return NULL ;
drivers/block/virtio_blk.c +2 -2
@@ -415,7 +415,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); }
@@ -917,7 +917,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; }
Signature · 1 line
2.25.1