[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/26] quorum: add missing coroutine_fn annotations
From: |
Paolo Bonzini |
Subject: |
[PATCH 18/26] quorum: add missing coroutine_fn annotations |
Date: |
Thu, 22 Sep 2022 10:49:16 +0200 |
Callers of coroutine_fn must be coroutine_fn themselves, or the call
must be within "if (qemu_in_coroutine())". Apply coroutine_fn to
functions where this holds.
Reviewed-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/quorum.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/block/quorum.c b/block/quorum.c
index f33f30d36b..5ff69d7443 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -161,11 +161,10 @@ static bool quorum_64bits_compare(QuorumVoteValue *a,
QuorumVoteValue *b)
return a->l == b->l;
}
-static QuorumAIOCB *quorum_aio_get(BlockDriverState *bs,
- QEMUIOVector *qiov,
- uint64_t offset,
- uint64_t bytes,
- int flags)
+static QuorumAIOCB *coroutine_fn quorum_aio_get(BlockDriverState *bs,
+ QEMUIOVector *qiov,
+ uint64_t offset, uint64_t
bytes,
+ int flags)
{
BDRVQuorumState *s = bs->opaque;
QuorumAIOCB *acb = g_new(QuorumAIOCB, 1);
@@ -273,7 +272,7 @@ static void quorum_report_bad_versions(BDRVQuorumState *s,
}
}
-static void quorum_rewrite_entry(void *opaque)
+static void coroutine_fn quorum_rewrite_entry(void *opaque)
{
QuorumCo *co = opaque;
QuorumAIOCB *acb = co->acb;
@@ -574,7 +573,7 @@ free_exit:
quorum_free_vote_list(&acb->votes);
}
-static void read_quorum_children_entry(void *opaque)
+static void coroutine_fn read_quorum_children_entry(void *opaque)
{
QuorumCo *co = opaque;
QuorumAIOCB *acb = co->acb;
@@ -602,7 +601,7 @@ static void read_quorum_children_entry(void *opaque)
}
}
-static int read_quorum_children(QuorumAIOCB *acb)
+static int coroutine_fn read_quorum_children(QuorumAIOCB *acb)
{
BDRVQuorumState *s = acb->bs->opaque;
int i;
@@ -643,7 +642,7 @@ static int read_quorum_children(QuorumAIOCB *acb)
return acb->vote_ret;
}
-static int read_fifo_child(QuorumAIOCB *acb)
+static int coroutine_fn read_fifo_child(QuorumAIOCB *acb)
{
BDRVQuorumState *s = acb->bs->opaque;
int n, ret;
@@ -664,8 +663,9 @@ static int read_fifo_child(QuorumAIOCB *acb)
return ret;
}
-static int quorum_co_preadv(BlockDriverState *bs, int64_t offset, int64_t
bytes,
- QEMUIOVector *qiov, BdrvRequestFlags flags)
+static int coroutine_fn quorum_co_preadv(BlockDriverState *bs,
+ int64_t offset, int64_t bytes,
+ QEMUIOVector *qiov, BdrvRequestFlags
flags)
{
BDRVQuorumState *s = bs->opaque;
QuorumAIOCB *acb = quorum_aio_get(bs, qiov, offset, bytes, flags);
@@ -684,7 +684,7 @@ static int quorum_co_preadv(BlockDriverState *bs, int64_t
offset, int64_t bytes,
return ret;
}
-static void write_quorum_entry(void *opaque)
+static void coroutine_fn write_quorum_entry(void *opaque)
{
QuorumCo *co = opaque;
QuorumAIOCB *acb = co->acb;
@@ -715,9 +715,9 @@ static void write_quorum_entry(void *opaque)
}
}
-static int quorum_co_pwritev(BlockDriverState *bs, int64_t offset,
- int64_t bytes, QEMUIOVector *qiov,
- BdrvRequestFlags flags)
+static int coroutine_fn quorum_co_pwritev(BlockDriverState *bs, int64_t offset,
+ int64_t bytes, QEMUIOVector *qiov,
+ BdrvRequestFlags flags)
{
BDRVQuorumState *s = bs->opaque;
QuorumAIOCB *acb = quorum_aio_get(bs, qiov, offset, bytes, flags);
@@ -746,8 +746,9 @@ static int quorum_co_pwritev(BlockDriverState *bs, int64_t
offset,
return ret;
}
-static int quorum_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,
- int64_t bytes, BdrvRequestFlags flags)
+static int coroutine_fn quorum_co_pwrite_zeroes(BlockDriverState *bs,
+ int64_t offset, int64_t bytes,
+ BdrvRequestFlags flags)
{
return quorum_co_pwritev(bs, offset, bytes, NULL,
--
2.37.3
- [PATCH 04/26] nbd: remove incorrect coroutine_fn annotations, (continued)
- [PATCH 04/26] nbd: remove incorrect coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 08/26] file-posix: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 15/26] copy-before-write: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 11/26] nfs: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 07/26] blkverify: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 26/26] test-coroutine: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 16/26] curl: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 03/26] qcow2: remove incorrect coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 13/26] parallels: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 14/26] qcow2: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 18/26] quorum: add missing coroutine_fn annotations,
Paolo Bonzini <=
- [PATCH 12/26] nvme: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 10/26] nbd: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 20/26] vmdk: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 25/26] migration: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 17/26] qed: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 19/26] throttle: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 22/26] coroutine-lock: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 24/26] 9p: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 21/26] job: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22
- [PATCH 23/26] raw-format: add missing coroutine_fn annotations, Paolo Bonzini, 2022/09/22