[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/11] block/mirror: Drop mirror_wait_for_any_operation()
From: |
Kevin Wolf |
Subject: |
[PULL 02/11] block/mirror: Drop mirror_wait_for_any_operation() |
Date: |
Fri, 11 Nov 2022 16:27:35 +0100 |
From: Hanna Reitz <hreitz@redhat.com>
mirror_wait_for_free_in_flight_slot() is the only remaining user of
mirror_wait_for_any_operation(), so inline the latter into the former.
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20221109165452.67927-3-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/mirror.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index e5467b0053..5b6f42392c 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -305,19 +305,21 @@ static int mirror_cow_align(MirrorBlockJob *s, int64_t
*offset,
}
static inline void coroutine_fn
-mirror_wait_for_any_operation(MirrorBlockJob *s, bool active)
+mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
{
MirrorOp *op;
QTAILQ_FOREACH(op, &s->ops_in_flight, next) {
- /* Do not wait on pseudo ops, because it may in turn wait on
+ /*
+ * Do not wait on pseudo ops, because it may in turn wait on
* some other operation to start, which may in fact be the
* caller of this function. Since there is only one pseudo op
* at any given time, we will always find some real operation
- * to wait on. */
- if (!op->is_pseudo_op && op->is_in_flight &&
- op->is_active_write == active)
- {
+ * to wait on.
+ * Also, do not wait on active operations, because they do not
+ * use up in-flight slots.
+ */
+ if (!op->is_pseudo_op && op->is_in_flight && !op->is_active_write) {
qemu_co_queue_wait(&op->waiting_requests, NULL);
return;
}
@@ -325,13 +327,6 @@ mirror_wait_for_any_operation(MirrorBlockJob *s, bool
active)
abort();
}
-static inline void coroutine_fn
-mirror_wait_for_free_in_flight_slot(MirrorBlockJob *s)
-{
- /* Only non-active operations use up in-flight slots */
- mirror_wait_for_any_operation(s, false);
-}
-
/* Perform a mirror copy operation.
*
* *op->bytes_handled is set to the number of bytes copied after and
--
2.38.1
- [PULL 00/11] Block layer patches, Kevin Wolf, 2022/11/11
- [PULL 03/11] block/mirror: Fix NULL s->job in active writes, Kevin Wolf, 2022/11/11
- [PULL 04/11] iotests/151: Test that active mirror progresses, Kevin Wolf, 2022/11/11
- [PULL 02/11] block/mirror: Drop mirror_wait_for_any_operation(),
Kevin Wolf <=
- [PULL 01/11] block/mirror: Do not wait for active writes, Kevin Wolf, 2022/11/11
- [PULL 06/11] qapi/block-core: Fix BlockdevOptionsNvmeIoUring @path description, Kevin Wolf, 2022/11/11
- [PULL 05/11] iotests/151: Test active requests on mirror start, Kevin Wolf, 2022/11/11
- [PULL 07/11] block/blkio: Set BlockDriver::has_variable_length to false, Kevin Wolf, 2022/11/11
- [PULL 08/11] block: Make bdrv_child_get_parent_aio_context I/O, Kevin Wolf, 2022/11/11
- [PULL 09/11] block-backend: Update ctx immediately after root, Kevin Wolf, 2022/11/11
- [PULL 11/11] tests/stream-under-throttle: New test, Kevin Wolf, 2022/11/11
- [PULL 10/11] block: Start/end drain on correct AioContext, Kevin Wolf, 2022/11/11
- Re: [PULL 00/11] Block layer patches, Stefan Hajnoczi, 2022/11/11