[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 3/6] blockdev: qmp_transaction: refactor loop to classic for
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v9 3/6] blockdev: qmp_transaction: refactor loop to classic for |
Date: |
Wed, 10 May 2023 18:06:21 +0300 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
blockdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index f72084d206..f236e5c27e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2367,7 +2367,7 @@ void qmp_transaction(TransactionActionList *actions,
struct TransactionProperties *properties,
Error **errp)
{
- TransactionActionList *act = actions;
+ TransactionActionList *act;
bool has_properties = !!properties;
JobTxn *block_job_txn = NULL;
Error *local_err = NULL;
@@ -2387,14 +2387,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.34.1
- [PATCH v9 0/6] block: refactor blockdev transactions, Vladimir Sementsov-Ogievskiy, 2023/05/10
- [PATCH v9 5/6] blockdev: use state.bitmap in block-dirty-bitmap-add action, Vladimir Sementsov-Ogievskiy, 2023/05/10
- [PATCH v9 2/6] blockdev: transactions: rename some things, Vladimir Sementsov-Ogievskiy, 2023/05/10
- [PATCH v9 1/6] blockdev: refactor transaction to use Transaction API, Vladimir Sementsov-Ogievskiy, 2023/05/10
- [PATCH v9 4/6] blockdev: transaction: refactor handling transaction properties, Vladimir Sementsov-Ogievskiy, 2023/05/10
- [PATCH v9 3/6] blockdev: qmp_transaction: refactor loop to classic for,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v9 6/6] blockdev: qmp_transaction: drop extra generic layer, Vladimir Sementsov-Ogievskiy, 2023/05/10
- Re: [PATCH v9 0/6] block: refactor blockdev transactions, Vladimir Sementsov-Ogievskiy, 2023/05/10
- Re: [PATCH v9 0/6] block: refactor blockdev transactions, Kevin Wolf, 2023/05/11