mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
block: Convert bdrv_io_unplug() to co_wrapper
BlockDriver->bdrv_io_unplug is categorized as IO callback, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since the callback traverses the block nodes graph, which however is only possible in a coroutine. The only caller of this function is blk_io_unplug(), therefore make blk_io_unplug() a co_wrapper, so that we're always running in 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-4-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
8f49745432
commit
09d9fc97f8
8 changed files with 20 additions and 19 deletions
|
@ -2149,7 +2149,7 @@ static void coroutine_fn raw_co_io_plug(BlockDriverState *bs)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void raw_aio_unplug(BlockDriverState *bs)
|
||||
static void coroutine_fn raw_co_io_unplug(BlockDriverState *bs)
|
||||
{
|
||||
BDRVRawState __attribute__((unused)) *s = bs->opaque;
|
||||
#ifdef CONFIG_LINUX_AIO
|
||||
|
@ -3318,7 +3318,7 @@ BlockDriver bdrv_file = {
|
|||
.bdrv_co_copy_range_to = raw_co_copy_range_to,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
|
@ -3690,7 +3690,7 @@ static BlockDriver bdrv_host_device = {
|
|||
.bdrv_co_copy_range_to = raw_co_copy_range_to,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
|
@ -3814,7 +3814,7 @@ static BlockDriver bdrv_host_cdrom = {
|
|||
.bdrv_co_flush_to_disk = raw_co_flush_to_disk,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
|
@ -3944,7 +3944,7 @@ static BlockDriver bdrv_host_cdrom = {
|
|||
.bdrv_co_flush_to_disk = raw_co_flush_to_disk,
|
||||
.bdrv_refresh_limits = raw_refresh_limits,
|
||||
.bdrv_co_io_plug = raw_co_io_plug,
|
||||
.bdrv_io_unplug = raw_aio_unplug,
|
||||
.bdrv_co_io_unplug = raw_co_io_unplug,
|
||||
.bdrv_attach_aio_context = raw_aio_attach_aio_context,
|
||||
|
||||
.bdrv_co_truncate = raw_co_truncate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue