From 512da211010700cdbfaab45c8980ca88958a4ab8 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Tue, 26 Oct 2021 18:23:45 +0200 Subject: linux-aio: add `dev_max_batch` parameter to laio_co_submit() This new parameter can be used by block devices to limit the Linux AIO batch size more than the limit set by the AIO context. file-posix backend supports this, passing its `aio-max-batch` option previously added. Add an helper function to calculate the maximum batch size. Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Stefano Garzarella Message-Id: <20211026162346.253081-3-sgarzare@redhat.com> Signed-off-by: Kevin Wolf --- include/block/raw-aio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/block') diff --git a/include/block/raw-aio.h b/include/block/raw-aio.h index 251b10d..ebd042f 100644 --- a/include/block/raw-aio.h +++ b/include/block/raw-aio.h @@ -51,7 +51,8 @@ typedef struct LinuxAioState LinuxAioState; LinuxAioState *laio_init(Error **errp); void laio_cleanup(LinuxAioState *s); int coroutine_fn laio_co_submit(BlockDriverState *bs, LinuxAioState *s, int fd, - uint64_t offset, QEMUIOVector *qiov, int type); + uint64_t offset, QEMUIOVector *qiov, int type, + uint64_t dev_max_batch); void laio_detach_aio_context(LinuxAioState *s, AioContext *old_context); void laio_attach_aio_context(LinuxAioState *s, AioContext *new_context); void laio_io_plug(BlockDriverState *bs, LinuxAioState *s); -- cgit v1.1