mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 22:11:53 -06:00
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>
This commit is contained in:
parent
7e8c182fb5
commit
e08cc001d5
3 changed files with 19 additions and 14 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue