[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/58] Revert "block: Pass BdrvChild ** to replace_child_noperm"
From: |
Kevin Wolf |
Subject: |
[PULL 19/58] Revert "block: Pass BdrvChild ** to replace_child_noperm" |
Date: |
Thu, 27 Oct 2022 20:31:07 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
That's a preparation to previously reverted
"block: Let replace_child_noperm free children". Drop it too, we don't
need it for a new approach.
This reverts commit be64bbb0149748f3999c49b13976aafb8330ea86.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220726201134.924743-13-vsementsov@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/block.c b/block.c
index 2f80b7e094..683a9e0eff 100644
--- a/block.c
+++ b/block.c
@@ -90,7 +90,7 @@ static BlockDriverState *bdrv_open_inherit(const char
*filename,
static bool bdrv_recurse_has_child(BlockDriverState *bs,
BlockDriverState *child);
-static void bdrv_replace_child_noperm(BdrvChild **child,
+static void bdrv_replace_child_noperm(BdrvChild *child,
BlockDriverState *new_bs);
static void bdrv_remove_file_or_backing_child(BlockDriverState *bs,
BdrvChild *child,
@@ -2359,7 +2359,7 @@ static void bdrv_replace_child_abort(void *opaque)
GLOBAL_STATE_CODE();
/* old_bs reference is transparently moved from @s to @s->child */
- bdrv_replace_child_noperm(&s->child, s->old_bs);
+ bdrv_replace_child_noperm(s->child, s->old_bs);
bdrv_unref(new_bs);
}
@@ -2389,7 +2389,7 @@ static void bdrv_replace_child_tran(BdrvChild *child,
BlockDriverState *new_bs,
if (new_bs) {
bdrv_ref(new_bs);
}
- bdrv_replace_child_noperm(&child, new_bs);
+ bdrv_replace_child_noperm(child, new_bs);
/* old_bs reference is transparently moved from @child to @s */
}
@@ -2771,10 +2771,9 @@ uint64_t bdrv_qapi_perm_to_blk_perm(BlockPermission
qapi_perm)
return permissions[qapi_perm];
}
-static void bdrv_replace_child_noperm(BdrvChild **childp,
+static void bdrv_replace_child_noperm(BdrvChild *child,
BlockDriverState *new_bs)
{
- BdrvChild *child = *childp;
BlockDriverState *old_bs = child->bs;
int new_bs_quiesce_counter;
int drain_saldo;
@@ -2872,7 +2871,7 @@ static void bdrv_attach_child_common_abort(void *opaque)
BlockDriverState *bs = child->bs;
GLOBAL_STATE_CODE();
- bdrv_replace_child_noperm(s->child, NULL);
+ bdrv_replace_child_noperm(child, NULL);
if (bdrv_get_aio_context(bs) != s->old_child_ctx) {
bdrv_try_set_aio_context(bs, s->old_child_ctx, &error_abort);
@@ -2973,7 +2972,7 @@ static int bdrv_attach_child_common(BlockDriverState
*child_bs,
}
bdrv_ref(child_bs);
- bdrv_replace_child_noperm(&new_child, child_bs);
+ bdrv_replace_child_noperm(new_child, child_bs);
*child = new_child;
@@ -3029,13 +3028,13 @@ static int bdrv_attach_child_noperm(BlockDriverState
*parent_bs,
return 0;
}
-static void bdrv_detach_child(BdrvChild **childp)
+static void bdrv_detach_child(BdrvChild *child)
{
- BlockDriverState *old_bs = (*childp)->bs;
+ BlockDriverState *old_bs = child->bs;
GLOBAL_STATE_CODE();
- bdrv_replace_child_noperm(childp, NULL);
- bdrv_child_free(*childp);
+ bdrv_replace_child_noperm(child, NULL);
+ bdrv_child_free(child);
if (old_bs) {
/*
@@ -3147,7 +3146,7 @@ void bdrv_root_unref_child(BdrvChild *child)
GLOBAL_STATE_CODE();
child_bs = child->bs;
- bdrv_detach_child(&child);
+ bdrv_detach_child(child);
bdrv_unref(child_bs);
}
--
2.37.3
- [PULL 04/58] vvfat: allow some writes to bootsector, (continued)
- [PULL 04/58] vvfat: allow some writes to bootsector, Kevin Wolf, 2022/10/27
- [PULL 13/58] test-bdrv-graph-mod: fix filters to be filters, Kevin Wolf, 2022/10/27
- [PULL 10/58] block/blklogwrites: don't care to remove bs->file child on failure, Kevin Wolf, 2022/10/27
- [PULL 12/58] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing, Kevin Wolf, 2022/10/27
- [PULL 11/58] test-bdrv-graph-mod: update test_parallel_perm_update test case, Kevin Wolf, 2022/10/27
- [PULL 09/58] block: introduce bdrv_open_file_child() helper, Kevin Wolf, 2022/10/27
- [PULL 14/58] block: document connection between child roles and bs->backing/bs->file, Kevin Wolf, 2022/10/27
- [PULL 18/58] Revert "block: Restructure remove_file_or_backing_child()", Kevin Wolf, 2022/10/27
- [PULL 16/58] Revert "block: Let replace_child_noperm free children", Kevin Wolf, 2022/10/27
- [PULL 17/58] Revert "block: Let replace_child_tran keep indirect pointer", Kevin Wolf, 2022/10/27
- [PULL 19/58] Revert "block: Pass BdrvChild ** to replace_child_noperm",
Kevin Wolf <=
- [PULL 15/58] block/snapshot: stress that we fallback to primary child, Kevin Wolf, 2022/10/27
- [PULL 06/58] block/io_uring: revert "Use io_uring_register_ring_fd() to skip fd operations", Kevin Wolf, 2022/10/27
- [PULL 20/58] block: Manipulate bs->file / bs->backing pointers in .attach/.detach, Kevin Wolf, 2022/10/27
- [PULL 26/58] blockjob: implement .change_aio_ctx in child_job, Kevin Wolf, 2022/10/27
- [PULL 36/58] monitor: add missing coroutine_fn annotation, Kevin Wolf, 2022/10/27
- [PULL 29/58] block: use the new _change_ API instead of _can_set_ and _set_, Kevin Wolf, 2022/10/27
- [PULL 30/58] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks, Kevin Wolf, 2022/10/27
- [PULL 33/58] block/nfs: Fix 32-bit Windows build, Kevin Wolf, 2022/10/27
- [PULL 41/58] block: add missing coroutine_fn annotation to BlockDriverState callbacks, Kevin Wolf, 2022/10/27
- [PULL 25/58] bdrv_change_aio_context: use hash table instead of list of visited nodes, Kevin Wolf, 2022/10/27