diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2022-10-25 04:49:45 -0400 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-10-27 20:14:11 +0200 |
commit | e08cc001d502958040565636e19a42c06e1ae8b7 (patch) | |
tree | d775af529b1d7d598993d80c95ad1a30907d6a47 /include/block/block_int-common.h | |
parent | 7e8c182fb5e5950a52623b0d463c2f1fcd15a80a (diff) | |
download | qemu-e08cc001d502958040565636e19a42c06e1ae8b7.zip qemu-e08cc001d502958040565636e19a42c06e1ae8b7.tar.gz qemu-e08cc001d502958040565636e19a42c06e1ae8b7.tar.bz2 |
bdrv_change_aio_context: use hash table instead of list of visited nodes
Minor performance improvement, but given that we have hash tables
available, avoid iterating in the visited nodes list every time just
to check if a node has been already visited.
The data structure is not actually a proper hash map, but an hash set,
as we are just adding nodes and not key,value pairs.
Suggested-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20221025084952.2139888-4-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block_int-common.h')
-rw-r--r-- | include/block/block_int-common.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index 9067a99..7ccbbda 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -911,7 +911,8 @@ struct BdrvChildClass { void (*set_aio_ctx)(BdrvChild *child, AioContext *ctx, GSList **ignore); bool (*change_aio_ctx)(BdrvChild *child, AioContext *ctx, - GSList **visited, Transaction *tran, Error **errp); + GHashTable *visited, Transaction *tran, + Error **errp); AioContext *(*get_parent_aio_context)(BdrvChild *child); |