aboutsummaryrefslogtreecommitdiff
path: root/block/linux-aio.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-06-03 17:36:27 +0200
committerKevin Wolf <kwolf@redhat.com>2016-06-16 15:19:55 +0200
commit9d52aa3c38484703c05e791bac1ff588588a217c (patch)
treef3936cee7f30b44a358085479958b3b1d525293e /block/linux-aio.c
parent2174f12bdeb3974141784e14bbb7ad8c53178cd9 (diff)
downloadqemu-9d52aa3c38484703c05e791bac1ff588588a217c.zip
qemu-9d52aa3c38484703c05e791bac1ff588588a217c.tar.gz
qemu-9d52aa3c38484703c05e791bac1ff588588a217c.tar.bz2
raw-posix: Implement .bdrv_co_preadv/pwritev
The raw-posix block driver actually supports byte-aligned requests now on non-O_DIRECT images, like it already (and previously incorrectly) claimed in bs->request_alignment. For some block drivers this means that a RMW cycle can be avoided when they write sub-sector metadata e.g. for cluster allocation. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/linux-aio.c')
-rw-r--r--block/linux-aio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 657577a..fe7cece 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -271,15 +271,12 @@ static int laio_do_submit(int fd, struct qemu_laiocb *laiocb, off_t offset,
}
int coroutine_fn laio_co_submit(BlockDriverState *bs, LinuxAioState *s, int fd,
- int64_t sector_num, QEMUIOVector *qiov,
- int nb_sectors, int type)
+ uint64_t offset, QEMUIOVector *qiov, int type)
{
- off_t offset = sector_num * BDRV_SECTOR_SIZE;
int ret;
-
struct qemu_laiocb laiocb = {
.co = qemu_coroutine_self(),
- .nbytes = nb_sectors * BDRV_SECTOR_SIZE,
+ .nbytes = qiov->size,
.ctx = s,
.is_read = (type == QEMU_AIO_READ),
.qiov = qiov,