[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/23] bochs: mark more functions as coroutine_fns and GRAPH_RDLOC
From: |
Kevin Wolf |
Subject: |
[PULL 15/23] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK |
Date: |
Wed, 28 Jun 2023 16:15:18 +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. Change calls to co_wrappers to use the non-wrapped
functions, which in turn requires adding GRAPH_RDLOCK annotations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20230601115145.196465-5-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/bochs.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/bochs.c b/block/bochs.c
index 2f5ae52c90..66e7a58e5e 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -203,7 +203,8 @@ static void bochs_refresh_limits(BlockDriverState *bs,
Error **errp)
bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */
}
-static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num)
+static int64_t coroutine_fn GRAPH_RDLOCK
+seek_to_sector(BlockDriverState *bs, int64_t sector_num)
{
BDRVBochsState *s = bs->opaque;
uint64_t offset = sector_num * 512;
@@ -224,8 +225,8 @@ static int64_t seek_to_sector(BlockDriverState *bs, int64_t
sector_num)
(s->extent_blocks + s->bitmap_blocks));
/* read in bitmap for current extent */
- ret = bdrv_pread(bs->file, bitmap_offset + (extent_offset / 8), 1,
- &bitmap_entry, 0);
+ ret = bdrv_co_pread(bs->file, bitmap_offset + (extent_offset / 8), 1,
+ &bitmap_entry, 0);
if (ret < 0) {
return ret;
}
--
2.41.0
- [PULL 07/23] block: Fix AioContext locking in bdrv_open_inherit(), (continued)
- [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, 2023/06/28
- [PULL 15/23] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK,
Kevin Wolf <=
- [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