aboutsummaryrefslogtreecommitdiff
path: root/block/preallocate.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2023-01-13 21:42:06 +0100
committerKevin Wolf <kwolf@redhat.com>2023-02-01 16:52:32 +0100
commitbd53086e824397a7bf0e875eaa9b339cf8394d75 (patch)
treed889faddc024078e45f0d7a72a8389d59e1da0da /block/preallocate.c
parentd886257d84dd7c3d3f04c3b1e2e4749b47541ee5 (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/preallocate.c')
-rw-r--r--block/preallocate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/preallocate.c b/block/preallocate.c
index c9881942a3..c0dcf8c346 100644
--- a/block/preallocate.c
+++ b/block/preallocate.c
@@ -287,7 +287,7 @@ static bool coroutine_fn handle_write(BlockDriverState *bs, int64_t offset,
}
if (s->data_end < 0) {
- s->data_end = bdrv_getlength(bs->file->bs);
+ s->data_end = bdrv_co_getlength(bs->file->bs);
if (s->data_end < 0) {
return false;
}
@@ -309,7 +309,7 @@ static bool coroutine_fn handle_write(BlockDriverState *bs, int64_t offset,
}
if (s->file_end < 0) {
- s->file_end = bdrv_getlength(bs->file->bs);
+ s->file_end = bdrv_co_getlength(bs->file->bs);
if (s->file_end < 0) {
return false;
}
@@ -381,7 +381,7 @@ preallocate_co_truncate(BlockDriverState *bs, int64_t offset,
if (s->data_end >= 0 && offset > s->data_end) {
if (s->file_end < 0) {
- s->file_end = bdrv_getlength(bs->file->bs);
+ s->file_end = bdrv_co_getlength(bs->file->bs);
if (s->file_end < 0) {
error_setg(errp, "failed to get file length");
return s->file_end;