diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2021-10-26 18:23:45 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2021-11-02 13:03:35 +0100 |
commit | 512da211010700cdbfaab45c8980ca88958a4ab8 (patch) | |
tree | 8054868338e2b4c4f12e58e010e60a059ba91f1c /block/file-posix.c | |
parent | 684960d46267d6e6443b39ee98b3a95632ba8dc6 (diff) |
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 <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20211026162346.253081-3-sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/file-posix.c')
-rw-r--r-- | block/file-posix.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/file-posix.c b/block/file-posix.c index 7a289a9481..c2c94fca66 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2066,7 +2066,8 @@ static int coroutine_fn raw_co_prw(BlockDriverState *bs, uint64_t offset, } else if (s->use_linux_aio) { LinuxAioState *aio = aio_get_linux_aio(bdrv_get_aio_context(bs)); assert(qiov->size == bytes); - return laio_co_submit(bs, aio, s->fd, offset, qiov, type); + return laio_co_submit(bs, aio, s->fd, offset, qiov, type, + s->aio_max_batch); #endif } |