[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 27/36] block: drop ignore_children for permission update funct
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 27/36] block: drop ignore_children for permission update functions |
Date: |
Fri, 27 Nov 2020 17:45:13 +0300 |
This argument is always NULL. Drop it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block.c | 36 +++++++++++-------------------------
1 file changed, 11 insertions(+), 25 deletions(-)
diff --git a/block.c b/block.c
index e835a78f06..54fb6d24bd 100644
--- a/block.c
+++ b/block.c
@@ -1934,7 +1934,6 @@ static int bdrv_fill_options(QDict **options, const char
*filename,
static int bdrv_check_update_perm(BlockDriverState *bs, BlockReopenQueue *q,
uint64_t new_used_perm,
uint64_t new_shared_perm,
- GSList *ignore_children,
Error **errp);
typedef struct BlockReopenQueueEntry {
@@ -2011,9 +2010,7 @@ static bool bdrv_a_allow_b(BdrvChild *a, BdrvChild *b,
Error **errp)
return false;
}
-static bool bdrv_check_parents_compliance(BlockDriverState *bs,
- GSList *ignore_children,
- Error **errp)
+static bool bdrv_check_parents_compliance(BlockDriverState *bs, Error **errp)
{
BdrvChild *a, *b;
@@ -2024,9 +2021,7 @@ static bool
bdrv_check_parents_compliance(BlockDriverState *bs,
*/
QLIST_FOREACH(a, &bs->parents, next_parent) {
QLIST_FOREACH(b, &bs->parents, next_parent) {
- if (a == b || g_slist_find(ignore_children, a) ||
- g_slist_find(ignore_children, b))
- {
+ if (a == b) {
continue;
}
@@ -2243,7 +2238,6 @@ static void bdrv_replace_child_safe(BdrvChild *child,
BlockDriverState *new_bs,
static int bdrv_node_check_perm(BlockDriverState *bs, BlockReopenQueue *q,
uint64_t cumulative_perms,
uint64_t cumulative_shared_perms,
- GSList *ignore_children,
GSList **tran, Error **errp)
{
BlockDriver *drv = bs->drv;
@@ -2326,7 +2320,6 @@ static int bdrv_check_perm_common(GSList *list,
BlockReopenQueue *q,
bool use_cumulative_perms,
uint64_t cumulative_perms,
uint64_t cumulative_shared_perms,
- GSList *ignore_children,
GSList **tran, Error **errp)
{
int ret;
@@ -2337,7 +2330,7 @@ static int bdrv_check_perm_common(GSList *list,
BlockReopenQueue *q,
ret = bdrv_node_check_perm(bs, q, cumulative_perms,
cumulative_shared_perms,
- ignore_children, tran, errp);
+ tran, errp);
if (ret < 0) {
return ret;
}
@@ -2348,7 +2341,7 @@ static int bdrv_check_perm_common(GSList *list,
BlockReopenQueue *q,
for ( ; list; list = list->next) {
bs = list->data;
- if (!bdrv_check_parents_compliance(bs, ignore_children, errp)) {
+ if (!bdrv_check_parents_compliance(bs, errp)) {
return -EINVAL;
}
@@ -2357,7 +2350,7 @@ static int bdrv_check_perm_common(GSList *list,
BlockReopenQueue *q,
ret = bdrv_node_check_perm(bs, q, cumulative_perms,
cumulative_shared_perms,
- ignore_children, tran, errp);
+ tran, errp);
if (ret < 0) {
return ret;
}
@@ -2368,19 +2361,17 @@ static int bdrv_check_perm_common(GSList *list,
BlockReopenQueue *q,
static int bdrv_check_perm(BlockDriverState *bs, BlockReopenQueue *q,
uint64_t cumulative_perms,
- uint64_t cumulative_shared_perms,
- GSList *ignore_children, Error **errp)
+ uint64_t cumulative_shared_perms, Error **errp)
{
g_autoptr(GSList) list = bdrv_topological_dfs(NULL, NULL, bs);
return bdrv_check_perm_common(list, q, true, cumulative_perms,
- cumulative_shared_perms, ignore_children,
- NULL, errp);
+ cumulative_shared_perms, NULL, errp);
}
static int bdrv_list_refresh_perms(GSList *list, BlockReopenQueue *q,
GSList **tran, Error **errp)
{
- return bdrv_check_perm_common(list, q, false, 0, 0, NULL, tran, errp);
+ return bdrv_check_perm_common(list, q, false, 0, 0, tran, errp);
}
/*
@@ -2509,7 +2500,6 @@ char *bdrv_perm_names(uint64_t perm)
static int bdrv_check_update_perm(BlockDriverState *bs, BlockReopenQueue *q,
uint64_t new_used_perm,
uint64_t new_shared_perm,
- GSList *ignore_children,
Error **errp)
{
BdrvChild *c;
@@ -2521,10 +2511,6 @@ static int bdrv_check_update_perm(BlockDriverState *bs,
BlockReopenQueue *q,
assert(new_shared_perm & BLK_PERM_WRITE_UNCHANGED);
QLIST_FOREACH(c, &bs->parents, next_parent) {
- if (g_slist_find(ignore_children, c)) {
- continue;
- }
-
if ((new_used_perm & c->shared_perm) != new_used_perm) {
char *user = bdrv_child_user_desc(c);
char *perm_names = bdrv_perm_names(new_used_perm &
~c->shared_perm);
@@ -2554,7 +2540,7 @@ static int bdrv_check_update_perm(BlockDriverState *bs,
BlockReopenQueue *q,
}
return bdrv_check_perm(bs, q, cumulative_perms, cumulative_shared_perms,
- ignore_children, errp);
+ errp);
}
static int bdrv_refresh_perms(BlockDriverState *bs, Error **errp)
@@ -4149,7 +4135,7 @@ int bdrv_reopen_multiple(BlockReopenQueue *bs_queue,
Error **errp)
QTAILQ_FOREACH(bs_entry, bs_queue, entry) {
BDRVReopenState *state = &bs_entry->state;
ret = bdrv_check_perm(state->bs, bs_queue, state->perm,
- state->shared_perm, NULL, errp);
+ state->shared_perm, errp);
if (ret < 0) {
goto cleanup_perm;
}
@@ -4161,7 +4147,7 @@ int bdrv_reopen_multiple(BlockReopenQueue *bs_queue,
Error **errp)
bs_queue, state->perm, state->shared_perm,
&nperm, &nshared);
ret = bdrv_check_update_perm(state->new_backing_bs, NULL,
- nperm, nshared, NULL, errp);
+ nperm, nshared, errp);
if (ret < 0) {
goto cleanup_perm;
}
--
2.21.3
- [PATCH v2 16/36] block: add bdrv_drv_set_perm transaction action, (continued)
- [PATCH v2 16/36] block: add bdrv_drv_set_perm transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 26/36] block/backup-top: drop .active, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 21/36] block: add bdrv_attach_child_noperm() transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 28/36] block: add bdrv_set_backing_noperm() transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 02/36] tests/test-bdrv-graph-mod: add test_parallel_perm_update, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 18/36] block: add bdrv_replace_child_safe() transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 22/36] block: split out bdrv_replace_node_noperm(), Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 24/36] block: add bdrv_remove_backing transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 03/36] block: bdrv_append(): don't consume reference, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 25/36] block: introduce bdrv_drop_filter(), Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 27/36] block: drop ignore_children for permission update functions,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 29/36] blockdev: qmp_x_blockdev_reopen: acquire all contexts, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 33/36] block: inline bdrv_replace_child(), Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 30/36] block: bdrv_reopen_multiple: refresh permissions on updated graph, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 32/36] block: inline bdrv_check_perm_common(), Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 31/36] block: drop unused permission update functions, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 04/36] block: bdrv_append(): return status, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 05/36] block: add bdrv_parent_try_set_aio_context, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 35/36] block: rename bdrv_replace_child_safe() to bdrv_replace_child(), Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 34/36] block: refactor bdrv_child_set_perm_safe() transaction action, Vladimir Sementsov-Ogievskiy, 2020/11/27
- [PATCH v2 36/36] block: refactor bdrv_node_check_perm(), Vladimir Sementsov-Ogievskiy, 2020/11/27