[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/15] block: Don't use subtree drains in bdrv_drop_intermedia
From: |
Kevin Wolf |
Subject: |
[PATCH v2 08/15] block: Don't use subtree drains in bdrv_drop_intermediate() |
Date: |
Fri, 18 Nov 2022 18:41:03 +0100 |
Instead of using a subtree drain from the top node (which also drains
child nodes of base that we're not even interested in), use a normal
drain for base, which automatically drains all of the parents, too.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
---
block.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 59eafcc54c..298954d514 100644
--- a/block.c
+++ b/block.c
@@ -5599,7 +5599,7 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
GLOBAL_STATE_CODE();
bdrv_ref(top);
- bdrv_subtree_drained_begin(top);
+ bdrv_drained_begin(base);
if (!top->drv || !base->drv) {
goto exit;
@@ -5672,7 +5672,7 @@ int bdrv_drop_intermediate(BlockDriverState *top,
BlockDriverState *base,
ret = 0;
exit:
- bdrv_subtree_drained_end(top);
+ bdrv_drained_end(base);
bdrv_unref(top);
return ret;
}
--
2.38.1
- [PATCH v2 00/15] block: Simplify drain, Kevin Wolf, 2022/11/18
- [PATCH v2 01/15] qed: Don't yield in bdrv_qed_co_drain_begin(), Kevin Wolf, 2022/11/18
- [PATCH v2 02/15] test-bdrv-drain: Don't yield in .bdrv_co_drained_begin/end(), Kevin Wolf, 2022/11/18
- [PATCH v2 05/15] block: Inline bdrv_drain_invoke(), Kevin Wolf, 2022/11/18
- [PATCH v2 03/15] block: Revert .bdrv_drained_begin/end to non-coroutine_fn, Kevin Wolf, 2022/11/18
- [PATCH v2 04/15] block: Remove drained_end_counter, Kevin Wolf, 2022/11/18
- [PATCH v2 06/15] block: Fix locking for bdrv_reopen_queue_child(), Kevin Wolf, 2022/11/18
- [PATCH v2 07/15] block: Drain invidual nodes during reopen, Kevin Wolf, 2022/11/18
- [PATCH v2 08/15] block: Don't use subtree drains in bdrv_drop_intermediate(),
Kevin Wolf <=
- [PATCH v2 11/15] block: Call drain callbacks only once, Kevin Wolf, 2022/11/18
- [PATCH v2 12/15] block: Remove ignore_bds_parents parameter from drain_begin/end., Kevin Wolf, 2022/11/18
- [PATCH v2 13/15] block: Drop out of coroutine in bdrv_do_drained_begin_quiesce(), Kevin Wolf, 2022/11/18
- [PATCH v2 09/15] stream: Replace subtree drain with a single node drain, Kevin Wolf, 2022/11/18
- [PATCH v2 14/15] block: Don't poll in bdrv_replace_child_noperm(), Kevin Wolf, 2022/11/18