OSDN Git Service

block: remove AIOCBInfo->get_aio_context()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 12 Sep 2023 23:10:33 +0000 (19:10 -0400)
committerKevin Wolf <kwolf@redhat.com>
Wed, 20 Sep 2023 15:46:01 +0000 (17:46 +0200)
commit652b0dd80815cdb03db9320572be1cc9f9f664a1
tree3abdca8f01e6c26f23ea874f92d75b05472c6848
parent52b10c9c0c68e90f9503ba578f2eaf8975c1977f
block: remove AIOCBInfo->get_aio_context()

The synchronous bdrv_aio_cancel() function needs the acb's AioContext so
it can call aio_poll() to wait for cancellation.

It turns out that all users run under the BQL in the main AioContext, so
this callback is not needed.

Remove the callback, mark bdrv_aio_cancel() GLOBAL_STATE_CODE just like
its blk_aio_cancel() caller, and poll the main loop AioContext.

The purpose of this cleanup is to identify bdrv_aio_cancel() as an API
that does not work with the multi-queue block layer.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20230912231037.826804-2-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/block-backend.c
block/io.c
hw/nvme/ctrl.c
include/block/aio.h
include/block/block-global-state.h
include/block/block-io.h
softmmu/dma-helpers.c
util/thread-pool.c