[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 8/8] Avoid calls from coroutine_fn to no_coroutine_fn
From: |
Alberto Faria |
Subject: |
[RFC 8/8] Avoid calls from coroutine_fn to no_coroutine_fn |
Date: |
Sat, 2 Jul 2022 12:33:31 +0100 |
These calls were found by static-analyzer.py.
Signed-off-by: Alberto Faria <afaria@redhat.com>
---
block/block-backend.c | 2 +-
block/io.c | 10 +++++-----
block/parallels.c | 4 ++--
block/qcow2-refcount.c | 2 +-
block/qed-table.c | 2 +-
block/qed.c | 2 +-
block/vmdk.c | 4 ++--
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index 5f2a912a59..8fa48576cd 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1395,7 +1395,7 @@ static int coroutine_fn blk_pwritev_part(BlockBackend
*blk, int64_t offset,
int ret;
blk_inc_in_flight(blk);
- ret = blk_do_pwritev_part(blk, offset, bytes, qiov, qiov_offset, flags);
+ ret = blk_co_do_pwritev_part(blk, offset, bytes, qiov, qiov_offset, flags);
blk_dec_in_flight(blk);
return ret;
diff --git a/block/io.c b/block/io.c
index bbfe94503b..832bccd31e 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2781,8 +2781,8 @@ int coroutine_fn bdrv_co_is_zero_fast(BlockDriverState
*bs, int64_t offset,
return 1;
}
- ret = bdrv_common_block_status_above(bs, NULL, false, false, offset,
- bytes, &pnum, NULL, NULL, NULL);
+ ret = bdrv_co_common_block_status_above(bs, NULL, false, false, offset,
+ bytes, &pnum, NULL, NULL, NULL);
if (ret < 0) {
return ret;
@@ -2798,9 +2798,9 @@ int coroutine_fn bdrv_is_allocated(BlockDriverState *bs,
int64_t offset,
int64_t dummy;
IO_CODE();
- ret = bdrv_common_block_status_above(bs, bs, true, false, offset,
- bytes, pnum ? pnum : &dummy, NULL,
- NULL, NULL);
+ ret = bdrv_co_common_block_status_above(bs, bs, true, false, offset,
+ bytes, pnum ? pnum : &dummy, NULL,
+ NULL, NULL);
if (ret < 0) {
return ret;
}
diff --git a/block/parallels.c b/block/parallels.c
index 8879b7027a..22c59a1ee2 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -503,8 +503,8 @@ static int coroutine_fn parallels_co_check(BlockDriverState
*bs,
* In order to really repair the image, we must shrink it.
* That means we have to pass exact=true.
*/
- ret = bdrv_truncate(bs->file, res->image_end_offset, true,
- PREALLOC_MODE_OFF, 0, &local_err);
+ ret = bdrv_co_truncate(bs->file, res->image_end_offset, true,
+ PREALLOC_MODE_OFF, 0, &local_err);
if (ret < 0) {
error_report_err(local_err);
res->check_errors++;
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index ed0ecfaa89..e30fd38e14 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1233,7 +1233,7 @@ int coroutine_fn qcow2_flush_caches(BlockDriverState *bs)
return ret;
}
- return bdrv_flush(bs->file->bs);
+ return bdrv_co_flush(bs->file->bs);
}
/*********************************************************/
diff --git a/block/qed-table.c b/block/qed-table.c
index 1cc844b1a5..aa203f2627 100644
--- a/block/qed-table.c
+++ b/block/qed-table.c
@@ -100,7 +100,7 @@ static int coroutine_fn qed_write_table(BDRVQEDState *s,
uint64_t offset,
}
if (flush) {
- ret = bdrv_flush(s->bs);
+ ret = bdrv_co_flush(s->bs);
if (ret < 0) {
goto out;
}
diff --git a/block/qed.c b/block/qed.c
index 96f4cda83f..dc9f065c02 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -490,7 +490,7 @@ static int coroutine_fn bdrv_qed_do_open(BlockDriverState
*bs, QDict *options,
}
/* From here on only known autoclear feature bits are valid */
- bdrv_flush(bs->file->bs);
+ bdrv_co_flush(bs->file->bs);
}
s->l1_table = qed_alloc_table(s);
diff --git a/block/vmdk.c b/block/vmdk.c
index 38e5ab3806..5c94a2f27c 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2150,8 +2150,8 @@ vmdk_co_pwritev_compressed(BlockDriverState *bs, int64_t
offset, int64_t bytes,
return length;
}
length = QEMU_ALIGN_UP(length, BDRV_SECTOR_SIZE);
- ret = bdrv_truncate(s->extents[i].file, length, false,
- PREALLOC_MODE_OFF, 0, NULL);
+ ret = bdrv_co_truncate(s->extents[i].file, length, false,
+ PREALLOC_MODE_OFF, 0, NULL);
if (ret < 0) {
return ret;
}
--
2.36.1
- Re: [RFC 4/8] Fix some direct calls from non-coroutine_fn to coroutine_fn, (continued)
[RFC 6/8] Fix some coroutine_fn indirect calls and pointer assignments, Alberto Faria, 2022/07/02
[RFC 7/8] block: Add no_coroutine_fn marker, Alberto Faria, 2022/07/02
[RFC 8/8] Avoid calls from coroutine_fn to no_coroutine_fn,
Alberto Faria <=
Re: [RFC 0/8] Introduce an extensible static analyzer, Paolo Bonzini, 2022/07/02
Re: [RFC 0/8] Introduce an extensible static analyzer, Daniel P . Berrangé, 2022/07/04
- Re: [RFC 0/8] Introduce an extensible static analyzer, Alberto Faria, 2022/07/04
- Re: [RFC 0/8] Introduce an extensible static analyzer, Daniel P . Berrangé, 2022/07/05
- Re: [RFC 0/8] Introduce an extensible static analyzer, Alberto Faria, 2022/07/05
- Re: [RFC 0/8] Introduce an extensible static analyzer, Daniel P . Berrangé, 2022/07/05
- Re: [RFC 0/8] Introduce an extensible static analyzer, Alberto Faria, 2022/07/06
- Re: [RFC 0/8] Introduce an extensible static analyzer, Daniel P . Berrangé, 2022/07/06
- Re: [RFC 0/8] Introduce an extensible static analyzer, Alberto Faria, 2022/07/08
Re: [RFC 0/8] Introduce an extensible static analyzer, Daniel P . Berrangé, 2022/07/05