[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 1/8] block-copy: add missing coroutine_fn annotations
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v3 1/8] block-copy: add missing coroutine_fn annotations |
Date: |
Wed, 16 Nov 2022 03:50:43 -0500 |
block_copy_reset_unallocated and block_copy_is_cluster_allocated are
only called by backup_run, a corotuine_fn itself.
Same applies to block_copy_block_status, called by
block_copy_dirty_clusters.
Therefore mark them as coroutine too.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block/block-copy.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index bb947afdda..f33ab1d0b6 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -577,8 +577,9 @@ static coroutine_fn int block_copy_task_entry(AioTask *task)
return ret;
}
-static int block_copy_block_status(BlockCopyState *s, int64_t offset,
- int64_t bytes, int64_t *pnum)
+static coroutine_fn int block_copy_block_status(BlockCopyState *s,
+ int64_t offset,
+ int64_t bytes, int64_t *pnum)
{
int64_t num;
BlockDriverState *base;
@@ -613,8 +614,9 @@ static int block_copy_block_status(BlockCopyState *s,
int64_t offset,
* Check if the cluster starting at offset is allocated or not.
* return via pnum the number of contiguous clusters sharing this allocation.
*/
-static int block_copy_is_cluster_allocated(BlockCopyState *s, int64_t offset,
- int64_t *pnum)
+static int coroutine_fn block_copy_is_cluster_allocated(BlockCopyState *s,
+ int64_t offset,
+ int64_t *pnum)
{
BlockDriverState *bs = s->source->bs;
int64_t count, total_count = 0;
@@ -669,8 +671,9 @@ void block_copy_reset(BlockCopyState *s, int64_t offset,
int64_t bytes)
* @return 0 when the cluster at @offset was unallocated,
* 1 otherwise, and -ret on error.
*/
-int64_t block_copy_reset_unallocated(BlockCopyState *s,
- int64_t offset, int64_t *count)
+int64_t coroutine_fn block_copy_reset_unallocated(BlockCopyState *s,
+ int64_t offset,
+ int64_t *count)
{
int ret;
int64_t clusters, bytes;
--
2.31.1
- [PATCH v3 0/8] Still more coroutine and various fixes in block layer, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 3/8] block-backend: replace bdrv_*_above with blk_*_above, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 5/8] block/vmdk: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 6/8] block: bdrv_create_file is a coroutine_fn, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 2/8] nbd/server.c: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 8/8] block/dirty-bitmap: remove unnecessary qemu_in_coroutine() case, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 4/8] block: distinguish between bdrv_create running in coroutine and not, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH v3 1/8] block-copy: add missing coroutine_fn annotations,
Emanuele Giuseppe Esposito <=
- [PATCH v3 7/8] block: bdrv_create is never called in coroutine context, Emanuele Giuseppe Esposito, 2022/11/16
- Re: [PATCH v3 0/8] Still more coroutine and various fixes in block layer, Emanuele Giuseppe Esposito, 2022/11/16