summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-28 23:32:34 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:20:05 -0700
commit8ad42cd0c002fa278f6d0135e22fcb188e400a28 (patch)
tree802d421f6ea5637541218df660bbd83b16e04b00 /drivers/block
parent6fd48b3be9f6d195a970b92040d097b5b886a99b (diff)
downloadlinux-8ad42cd0c002fa278f6d0135e22fcb188e400a28.tar.bz2
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: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 408e29f102c8..57e56617e45f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5011,8 +5011,6 @@ static void rbd_dev_device_release(struct device *dev)
rbd_dev->major = 0;
rbd_dev_id_put(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)
@@ -5032,6 +5030,7 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
}
rbd_assert(second);
rbd_bus_del_dev(second);
+ rbd_dev_image_release(second);
first->parent = NULL;
first->parent_overlap = 0;
@@ -5077,6 +5076,7 @@ static ssize_t rbd_remove(struct bus_type *bus,
goto done;
ret = count;
rbd_bus_del_dev(rbd_dev);
+ rbd_dev_image_release(rbd_dev);
module_put(THIS_MODULE);
done:
mutex_unlock(&ctl_mutex);