Commit cd30e8bd authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Ilya Dryomov

rbd: remove usage of the deprecated ida_simple_*() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, while that
of ida_alloc_max() is inclusive, so 1 has been subtracted.

[ idryomov: tweak changelog ]
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 6613476e
...@@ -5326,7 +5326,7 @@ static void rbd_dev_release(struct device *dev) ...@@ -5326,7 +5326,7 @@ static void rbd_dev_release(struct device *dev)
if (need_put) { if (need_put) {
destroy_workqueue(rbd_dev->task_wq); 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); rbd_dev_free(rbd_dev);
...@@ -5402,9 +5402,9 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, ...@@ -5402,9 +5402,9 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
return NULL; return NULL;
/* get an id and fill in device name */ /* get an id and fill in device name */
rbd_dev->dev_id = ida_simple_get(&rbd_dev_id_ida, 0, rbd_dev->dev_id = ida_alloc_max(&rbd_dev_id_ida,
minor_to_rbd_dev_id(1 << MINORBITS), minor_to_rbd_dev_id(1 << MINORBITS) - 1,
GFP_KERNEL); GFP_KERNEL);
if (rbd_dev->dev_id < 0) if (rbd_dev->dev_id < 0)
goto fail_rbd_dev; goto fail_rbd_dev;
...@@ -5425,7 +5425,7 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc, ...@@ -5425,7 +5425,7 @@ static struct rbd_device *rbd_dev_create(struct rbd_client *rbdc,
return rbd_dev; return rbd_dev;
fail_dev_id: 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: fail_rbd_dev:
rbd_dev_free(rbd_dev); rbd_dev_free(rbd_dev);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment