[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/12] bochs: mark more functions as coroutine_fns and GRAPH_RDLO
From: |
Paolo Bonzini |
Subject: |
[PATCH 04/12] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK |
Date: |
Thu, 1 Jun 2023 13:51:37 +0200 |
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>
---
block/bochs.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/bochs.c b/block/bochs.c
index 2f5ae52c908d..66e7a58e5e31 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.40.1
- [PATCH 00/12] block: more fixes to coroutine_fn marking, Paolo Bonzini, 2023/06/01
- [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls, Paolo Bonzini, 2023/06/01
- [PATCH 03/12] vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 05/12] block: mark another function as coroutine_fns and GRAPH_UNLOCKED, Paolo Bonzini, 2023/06/01
- [PATCH 04/12] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK,
Paolo Bonzini <=
- [PATCH 06/12] cloop: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 02/12] qed: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 08/12] vmdk: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 11/12] block: use bdrv_co_getlength in coroutine context, Paolo Bonzini, 2023/06/01
- [PATCH 07/12] dmg: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 09/12] vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 10/12] qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 12/12] block: use bdrv_co_debug_event in coroutine context, Paolo Bonzini, 2023/06/01
- Re: [PATCH 00/12] block: more fixes to coroutine_fn marking, Kevin Wolf, 2023/06/28