]> git.proxmox.com Git - mirror_qemu.git/commit - block/file-posix.c
block: Convert bdrv_get_allocated_file_size() to co_wrapper
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Fri, 13 Jan 2023 20:42:07 +0000 (21:42 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 1 Feb 2023 15:52:32 +0000 (16:52 +0100)
commit82618d7bc341cb93b9ce9c206d7ec84cebe83d00
tree6975780788282725aee83e4ced9de182e9c7bf46
parentbd53086e824397a7bf0e875eaa9b339cf8394d75
block: Convert bdrv_get_allocated_file_size() to co_wrapper

bdrv_get_allocated_file_size() is categorized as an I/O function, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since it traverses the block nodes graph, which however is only
possible in a coroutine.

Therefore turn it into a co_wrapper to move the actual function into a
coroutine where the lock can be taken.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230113204212.359076-10-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block/file-posix.c
block/file-win32.c
block/gluster.c
block/nfs.c
block/null.c
block/qcow2-refcount.c
block/vmdk.c
include/block/block-io.h
include/block/block_int-common.h