On 02/23/2018 05:51 PM, John Snow wrote:
Simply apply a function transaction-wide.
A few more uses of this in forthcoming patches.
Signed-off-by: John Snow <js...@redhat.com>
---
blockjob.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
@@ -565,13 +577,7 @@ static void block_job_completed_txn_success(BlockJob *job)
}
}
/* We are the last completed job, commit the transaction. */
- QLIST_FOREACH_SAFE(other_job, &txn->jobs, txn_list, next) {
- ctx = blk_get_aio_context(other_job->blk);
- aio_context_acquire(ctx);
- assert(other_job->ret == 0);
We lost this assertion. Hopefully that doesn't matter in the long run.
- block_job_completed_single(other_job);
- aio_context_release(ctx);
- }
+ block_job_txn_apply(txn, block_job_completed_single);
}
/* Assumes the block_job_mutex is held */
Reviewed-by: Eric Blake <ebl...@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org