[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds |
Date: |
Mon, 25 Jul 2022 08:21:15 -0400 |
bdrv_child_cb_change_aio_ctx() is identical to
bdrv_child_cb_can_set_aio_ctx(), as we only need
to recursively go on the parent bs.
Note: bdrv_child_try_change_aio_context() is not called by
anyone at this point.
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block.c b/block.c
index 221bf90268..bcc9b0d099 100644
--- a/block.c
+++ b/block.c
@@ -1239,6 +1239,14 @@ static int bdrv_child_cb_inactivate(BdrvChild *child)
return 0;
}
+static bool bdrv_child_cb_change_aio_ctx(BdrvChild *child, AioContext *ctx,
+ GHashTable *visited, Transaction
*tran,
+ Error **errp)
+{
+ BlockDriverState *bs = child->opaque;
+ return bdrv_change_aio_context(bs, ctx, visited, tran, errp);
+}
+
static bool bdrv_child_cb_can_set_aio_ctx(BdrvChild *child, AioContext *ctx,
GSList **ignore, Error **errp)
{
@@ -1495,6 +1503,7 @@ const BdrvChildClass child_of_bds = {
.inactivate = bdrv_child_cb_inactivate,
.can_set_aio_ctx = bdrv_child_cb_can_set_aio_ctx,
.set_aio_ctx = bdrv_child_cb_set_aio_ctx,
+ .change_aio_ctx = bdrv_child_cb_change_aio_ctx,
.update_filename = bdrv_child_cb_update_filename,
.get_parent_aio_context = child_of_bds_get_parent_aio_context,
};
--
2.31.1
- [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 05/11] blockjob: implement .change_aio_ctx in child_job, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 07/11] block-backend: implement .change_aio_ctx in child_root, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 03/11] bdrv_change_aio_context: use hash table instead of list of visited nodes, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 09/11] block: remove all unused ->can_set_aio_ctx and ->set_aio_ctx callbacks, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 08/11] block: use the new _change_ API instead of _can_set_ and _set_, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 10/11] block: rename bdrv_child_try_change_aio_context in bdrv_try_change_aio_context, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 11/11] block: remove bdrv_try_set_aio_context and replace it with bdrv_try_change_aio_context, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 04/11] bdrv_child_try_change_aio_context: add transaction parameter, Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 02/11] block: use transactions as a replacement of ->{can_}set_aio_context(), Emanuele Giuseppe Esposito, 2022/07/25
- [PATCH v2 06/11] block: implement .change_aio_ctx in child_of_bds,
Emanuele Giuseppe Esposito <=
- [PATCH v2 01/11] block.c: assert bs->aio_context is written under BQL and drains, Emanuele Giuseppe Esposito, 2022/07/25
- Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions, Vladimir Sementsov-Ogievskiy, 2022/07/26
- Re: [PATCH v2 00/11] Refactor bdrv_try_set_aio_context using transactions, Vladimir Sementsov-Ogievskiy, 2022/07/27