[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for |
Date: |
Thu, 31 Mar 2022 00:28:42 +0300 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
---
blockdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 177f3ff989..b44f0ca101 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2386,7 +2386,7 @@ void qmp_transaction(TransactionActionList *actions,
struct TransactionProperties *properties,
Error **errp)
{
- TransactionActionList *act = actions;
+ TransactionActionList *act;
JobTxn *block_job_txn = NULL;
Error *local_err = NULL;
Transaction *tran = tran_new();
@@ -2405,14 +2405,11 @@ void qmp_transaction(TransactionActionList *actions,
bdrv_drain_all();
/* We don't do anything in this loop that commits us to the operations */
- while (NULL != act) {
- TransactionAction *dev_info = NULL;
+ for (act = actions; act; act = act->next) {
+ TransactionAction *dev_info = act->value;
const BlkActionOps *ops;
BlkActionState *state;
- dev_info = act->value;
- act = act->next;
-
assert(dev_info->type < ARRAY_SIZE(actions_map));
ops = &actions_map[dev_info->type];
--
2.35.1
- [PATCH v5 12/45] Revert "block: Pass BdrvChild ** to replace_child_noperm", (continued)
- [PATCH v5 12/45] Revert "block: Pass BdrvChild ** to replace_child_noperm", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 11/45] Revert "block: Restructure remove_file_or_backing_child()", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 17/45] block: drop bdrv_remove_filter_or_cow_child, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 16/45] block: drop bdrv_detach_child(), Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 18/45] block: bdrv_refresh_perms(): allow external tran, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 19/45] block: refactor bdrv_list_refresh_perms to allow any list of nodes, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 22/45] block: implemet bdrv_unref_tran(), Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 23/45] blockdev: refactor transaction to use Transaction API, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 26/45] blockdev: transaction: refactor handling transaction properties, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 25/45] blockdev: qmp_transaction: refactor loop to classic for,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v5 29/45] block: introduce BDRV_O_NOPERM flag, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 35/45] block: make bdrv_find_child() function public, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 36/45] block: bdrv_replace_child_bs(): move to external transaction, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 32/45] iotests: add blockdev-add-transaction, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 39/45] block: bdrv_get_xdbg_block_graph(): report export ids, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 44/45] block: bdrv_open_inherit: create BlockBackend only when necessary, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 10/45] Revert "block: Let replace_child_tran keep indirect pointer", Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr, Vladimir Sementsov-Ogievskiy, 2022/03/30
- [PATCH v5 15/45] block: refactor bdrv_remove_file_or_backing_child to bdrv_remove_child, Vladimir Sementsov-Ogievskiy, 2022/03/30