[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 44/58] qcow: manually add more coroutine_fn annotations
From: |
Kevin Wolf |
Subject: |
[PULL 44/58] qcow: manually add more coroutine_fn annotations |
Date: |
Thu, 27 Oct 2022 20:31:32 +0200 |
From: Paolo Bonzini <pbonzini@redhat.com>
get_cluster_offset() and decompress_cluster() are only called from
the read and write paths.
The validity of these was double-checked with Alberto Faria's static analyzer.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221013123711.620631-12-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/qcow.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/block/qcow.c b/block/qcow.c
index 72ed4c3321..46bbabd2e3 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -92,7 +92,8 @@ typedef struct BDRVQcowState {
static QemuOptsList qcow_create_opts;
-static int decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset);
+static int coroutine_fn decompress_cluster(BlockDriverState *bs,
+ uint64_t cluster_offset);
static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
{
@@ -349,10 +350,11 @@ static int qcow_reopen_prepare(BDRVReopenState *state,
* return 0 if not allocated, 1 if *result is assigned, and negative
* errno on failure.
*/
-static int get_cluster_offset(BlockDriverState *bs,
- uint64_t offset, int allocate,
- int compressed_size,
- int n_start, int n_end, uint64_t *result)
+static int coroutine_fn get_cluster_offset(BlockDriverState *bs,
+ uint64_t offset, int allocate,
+ int compressed_size,
+ int n_start, int n_end,
+ uint64_t *result)
{
BDRVQcowState *s = bs->opaque;
int min_index, i, j, l1_index, l2_index, ret;
@@ -583,7 +585,8 @@ static int decompress_buffer(uint8_t *out_buf, int
out_buf_size,
return 0;
}
-static int decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset)
+static int coroutine_fn decompress_cluster(BlockDriverState *bs,
+ uint64_t cluster_offset)
{
BDRVQcowState *s = bs->opaque;
int ret, csize;
--
2.37.3
- [PULL 29/58] block: use the new _change_ API instead of _can_set_ and _set_, (continued)
- [PULL 29/58] block: use the new _change_ API instead of _can_set_ and _set_, Kevin Wolf, 2022/10/27
- [PULL 43/58] blkdebug: add missing coroutine_fn annotation for indirect-called functions, Kevin Wolf, 2022/10/27
- [PULL 55/58] vhdx: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 53/58] qed: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 27/58] block: implement .change_aio_ctx in child_of_bds, Kevin Wolf, 2022/10/27
- [PULL 49/58] mirror: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 37/58] ssh: add missing coroutine_fn annotation, Kevin Wolf, 2022/10/27
- [PULL 26/58] blockjob: implement .change_aio_ctx in child_job, Kevin Wolf, 2022/10/27
- [PULL 23/58] block.c: assert bs->aio_context is written under BQL and drains, Kevin Wolf, 2022/10/27
- [PULL 38/58] block: add missing coroutine_fn annotation to prototypes, Kevin Wolf, 2022/10/27
- [PULL 44/58] qcow: manually add more coroutine_fn annotations,
Kevin Wolf <=
- [PULL 47/58] commit: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 46/58] vmdk: manually add more coroutine_fn annotations, Kevin Wolf, 2022/10/27
- [PULL 40/58] coroutine-io: add missing coroutine_fn annotation to prototypes, Kevin Wolf, 2022/10/27
- [PULL 51/58] qcow: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- [PULL 45/58] qcow2: manually add more coroutine_fn annotations, Kevin Wolf, 2022/10/27
- [PULL 58/58] block/block-backend: blk_set_enable_write_cache is IO_CODE, Kevin Wolf, 2022/10/27
- [PULL 57/58] monitor: switch to *_co_* functions, Kevin Wolf, 2022/10/27
- Re: [PULL 00/58] Block layer patches, Stefan Hajnoczi, 2022/10/30
- Re: [PULL 00/58] Block layer patches, Stefan Hajnoczi, 2022/10/31