Commit 29334ba4 authored by Alex Elder's avatar Alex Elder

rbd: kill rbd_update_mapping_size()

Since rbd_update_mapping_size() is now a trivial wrapper, just open
code it in its two callers.
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 00a653e2
...@@ -3118,15 +3118,6 @@ static int rbd_read_header(struct rbd_device *rbd_dev, ...@@ -3118,15 +3118,6 @@ static int rbd_read_header(struct rbd_device *rbd_dev,
return ret; return ret;
} }
static void rbd_update_mapping_size(struct rbd_device *rbd_dev)
{
if (rbd_dev->spec->snap_id != CEPH_NOSNAP)
return;
if (rbd_dev->mapping.size != rbd_dev->header.image_size)
rbd_dev->mapping.size = rbd_dev->header.image_size;
}
/* /*
* only read the first part of the ondisk header, without the snaps info * only read the first part of the ondisk header, without the snaps info
*/ */
...@@ -3143,7 +3134,9 @@ static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev) ...@@ -3143,7 +3134,9 @@ static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev)
/* Update image size, and check for resize of mapped image */ /* Update image size, and check for resize of mapped image */
rbd_dev->header.image_size = h.image_size; rbd_dev->header.image_size = h.image_size;
rbd_update_mapping_size(rbd_dev); if (rbd_dev->spec->snap_id == CEPH_NOSNAP)
if (rbd_dev->mapping.size != rbd_dev->header.image_size)
rbd_dev->mapping.size = rbd_dev->header.image_size;
/* rbd_dev->header.object_prefix shouldn't change */ /* rbd_dev->header.object_prefix shouldn't change */
kfree(rbd_dev->header.snap_sizes); kfree(rbd_dev->header.snap_sizes);
...@@ -4074,7 +4067,9 @@ static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev) ...@@ -4074,7 +4067,9 @@ static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev)
ret = rbd_dev_v2_image_size(rbd_dev); ret = rbd_dev_v2_image_size(rbd_dev);
if (ret) if (ret)
goto out; goto out;
rbd_update_mapping_size(rbd_dev); if (rbd_dev->spec->snap_id == CEPH_NOSNAP)
if (rbd_dev->mapping.size != rbd_dev->header.image_size)
rbd_dev->mapping.size = rbd_dev->header.image_size;
ret = rbd_dev_v2_snap_context(rbd_dev); ret = rbd_dev_v2_snap_context(rbd_dev);
dout("rbd_dev_v2_snap_context returned %d\n", ret); dout("rbd_dev_v2_snap_context returned %d\n", ret);
......
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