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>
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;
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;