[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/23] block: mark another function as coroutine_fns and GRAPH_UNL
From: |
Kevin Wolf |
Subject: |
[PULL 16/23] block: mark another function as coroutine_fns and GRAPH_UNLOCKED |
Date: |
Wed, 28 Jun 2023 16:15:19 +0200 |
From: Paolo Bonzini <pbonzini@redhat.com>
Mark functions as coroutine_fn when they are only called by other coroutine_fns
and they can suspend. Because this function operates on a BlockBackend, mark it
GRAPH_UNLOCKED.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20230601115145.196465-6-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 0cd1a12344..a307c151a8 100644
--- a/block.c
+++ b/block.c
@@ -555,8 +555,9 @@ int coroutine_fn bdrv_co_create(BlockDriver *drv, const
char *filename,
* On success, return @blk's actual length.
* Otherwise, return -errno.
*/
-static int64_t create_file_fallback_truncate(BlockBackend *blk,
- int64_t minimum_size, Error
**errp)
+static int64_t coroutine_fn GRAPH_UNLOCKED
+create_file_fallback_truncate(BlockBackend *blk, int64_t minimum_size,
+ Error **errp)
{
Error *local_err = NULL;
int64_t size;
@@ -564,14 +565,14 @@ static int64_t create_file_fallback_truncate(BlockBackend
*blk,
GLOBAL_STATE_CODE();
- ret = blk_truncate(blk, minimum_size, false, PREALLOC_MODE_OFF, 0,
- &local_err);
+ ret = blk_co_truncate(blk, minimum_size, false, PREALLOC_MODE_OFF, 0,
+ &local_err);
if (ret < 0 && ret != -ENOTSUP) {
error_propagate(errp, local_err);
return ret;
}
- size = blk_getlength(blk);
+ size = blk_co_getlength(blk);
if (size < 0) {
error_free(local_err);
error_setg_errno(errp, -size,
--
2.41.0
- [PULL 10/23] graph-lock: Unlock the AioContext while polling, (continued)
- [PULL 10/23] graph-lock: Unlock the AioContext while polling, Kevin Wolf, 2023/06/28
- [PULL 07/23] block: Fix AioContext locking in bdrv_open_inherit(), Kevin Wolf, 2023/06/28
- [PULL 14/23] vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 13/23] qed: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 03/23] test-block-iothread: Lock AioContext for blk_insert_bs(), Kevin Wolf, 2023/06/28
- [PULL 09/23] blockjob: Fix AioContext locking in block_job_add_bdrv(), Kevin Wolf, 2023/06/28
- [PULL 20/23] vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 12/23] file-posix: remove incorrect coroutine_fn calls, Kevin Wolf, 2023/06/28
- [PULL 19/23] vmdk: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 21/23] qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 16/23] block: mark another function as coroutine_fns and GRAPH_UNLOCKED,
Kevin Wolf <=
- [PULL 15/23] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- [PULL 23/23] block: use bdrv_co_debug_event in coroutine context, Kevin Wolf, 2023/06/28
- [PULL 22/23] block: use bdrv_co_getlength in coroutine context, Kevin Wolf, 2023/06/28
- [PULL 18/23] dmg: mark more functions as coroutine_fns and GRAPH_RDLOCK, Kevin Wolf, 2023/06/28
- Re: [PULL 00/23] Block layer patches, Richard Henderson, 2023/06/29