summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-08-29 17:11:07 -0500
committerAlex Elder <elder@inktank.com>2012-10-01 14:30:52 -0500
commit5ed1617731a1e9201c3541a9c05ce3ec73975589 (patch)
treecb18a94136c7e97ab3c2298cd16a8becaec812a2 /drivers/block
parent304f68086f8206da7c5930a9cb0207c91d1983a6 (diff)
downloadblackbird-op-linux-5ed1617731a1e9201c3541a9c05ce3ec73975589.tar.gz
blackbird-op-linux-5ed1617731a1e9201c3541a9c05ce3ec73975589.zip
rbd: call set_snap() before snap_devs_update()
rbd_header_set_snap() is a simple initialization routine for an rbd device's mapping. It has to be called after the snapshot context for the rbd_dev has been updated, but can be done before snapshot devices have been registered. Change the name to rbd_dev_set_mapping() to better reflect its purpose, and call it a little sooner, before registering snapshot devices. 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 0d812603e6d5..a9f5de2706ec 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -640,7 +640,7 @@ static int snap_by_name(struct rbd_device *rbd_dev, const char *snap_name)
return -ENOENT;
}
-static int rbd_header_set_snap(struct rbd_device *rbd_dev, char *snap_name)
+static int rbd_dev_set_mapping(struct rbd_device *rbd_dev, char *snap_name)
{
int ret;
@@ -2625,12 +2625,13 @@ static ssize_t rbd_add(struct bus_type *bus,
rc = rbd_dev_snaps_update(rbd_dev);
if (rc)
goto err_out_bus;
- rc = rbd_dev_snaps_register(rbd_dev);
+
+ rc = rbd_dev_set_mapping(rbd_dev, snap_name);
if (rc)
goto err_out_bus;
down_write(&rbd_dev->header_rwsem);
- rc = rbd_header_set_snap(rbd_dev, snap_name);
+ rc = rbd_dev_snaps_register(rbd_dev);
up_write(&rbd_dev->header_rwsem);
if (rc)
goto err_out_bus;
OpenPOWER on IntegriCloud