diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2023-01-13 21:42:06 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-02-01 16:52:32 +0100 |
commit | bd53086e824397a7bf0e875eaa9b339cf8394d75 (patch) | |
tree | d889faddc024078e45f0d7a72a8389d59e1da0da /block/io.c | |
parent | d886257d84dd7c3d3f04c3b1e2e4749b47541ee5 (diff) |
block: use bdrv_co_refresh_total_sectors when possible
In some places we are sure we are always running in a
coroutine, therefore it's useless to call the generated_co_wrapper,
instead call directly the _co_ function.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230113204212.359076-9-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/io.c b/block/io.c index d78ad87e3c..e77087a7e8 100644 --- a/block/io.c +++ b/block/io.c @@ -3444,7 +3444,7 @@ int coroutine_fn bdrv_co_truncate(BdrvChild *child, int64_t offset, bool exact, if (new_bytes && backing) { int64_t backing_len; - backing_len = bdrv_getlength(backing->bs); + backing_len = bdrv_co_getlength(backing->bs); if (backing_len < 0) { ret = backing_len; error_setg_errno(errp, -ret, "Could not get backing file size"); @@ -3474,7 +3474,7 @@ int coroutine_fn bdrv_co_truncate(BdrvChild *child, int64_t offset, bool exact, goto out; } - ret = bdrv_refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); + ret = bdrv_co_refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); if (ret < 0) { error_setg_errno(errp, -ret, "Could not refresh total sector count"); } else { |