Commit 8ad42cd0 authored by Alex Elder's avatar Alex Elder Committed by Sage Weil

rbd: don't have device release destroy rbd_dev

Currently an rbd_device structure gets destroyed from the release
routine for the device embedded within it.  Stop doing that, instead
calling rbd_dev_image_release() right after rbd_bus_del_dev()
wherever the latter is called.
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 6fd48b3b
...@@ -5011,8 +5011,6 @@ static void rbd_dev_device_release(struct device *dev) ...@@ -5011,8 +5011,6 @@ static void rbd_dev_device_release(struct device *dev)
rbd_dev->major = 0; rbd_dev->major = 0;
rbd_dev_id_put(rbd_dev); rbd_dev_id_put(rbd_dev);
rbd_dev_mapping_clear(rbd_dev); rbd_dev_mapping_clear(rbd_dev);
rbd_dev_image_release(rbd_dev);
} }
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
...@@ -5032,6 +5030,7 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) ...@@ -5032,6 +5030,7 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
} }
rbd_assert(second); rbd_assert(second);
rbd_bus_del_dev(second); rbd_bus_del_dev(second);
rbd_dev_image_release(second);
first->parent = NULL; first->parent = NULL;
first->parent_overlap = 0; first->parent_overlap = 0;
...@@ -5077,6 +5076,7 @@ static ssize_t rbd_remove(struct bus_type *bus, ...@@ -5077,6 +5076,7 @@ static ssize_t rbd_remove(struct bus_type *bus,
goto done; goto done;
ret = count; ret = count;
rbd_bus_del_dev(rbd_dev); rbd_bus_del_dev(rbd_dev);
rbd_dev_image_release(rbd_dev);
module_put(THIS_MODULE); module_put(THIS_MODULE);
done: done:
mutex_unlock(&ctl_mutex); mutex_unlock(&ctl_mutex);
......
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