[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwr
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev |
Date: |
Tue, 14 Jun 2016 08:15:18 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 06/14/2016 07:32 AM, Kevin Wolf wrote:
> 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 <address@hidden>
> ---
> block/linux-aio.c | 7 ++-----
> block/raw-aio.h | 3 +--
> block/raw-posix.c | 43 +++++++++++++++++++++++--------------------
> 3 files changed, 26 insertions(+), 27 deletions(-)
>
> -static int coroutine_fn raw_co_readv(BlockDriverState *bs, int64_t
> sector_num,
> - int nb_sectors, QEMUIOVector *qiov)
> +static int coroutine_fn raw_co_preadv(BlockDriverState *bs, uint64_t offset,
> + uint64_t bytes, QEMUIOVector *qiov,
> + int flags)
> {
> - return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_READ);
> + return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_READ);
> }
>
> -static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t
> sector_num,
> - int nb_sectors, QEMUIOVector *qiov)
> +static int coroutine_fn raw_co_pwritev(BlockDriverState *bs, uint64_t offset,
> + uint64_t bytes, QEMUIOVector *qiov,
> + int flags)
> {
> - return raw_co_rw(bs, sector_num, nb_sectors, qiov, QEMU_AIO_WRITE);
> + assert(flags == 0);
> + return raw_co_prw(bs, offset, bytes, qiov, QEMU_AIO_WRITE);
> }
Looks odd to assert !flags on pwritev but not on preadv. Minor enough
that you could fix on pull request.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v2 0/6] block: Enable byte granularity I/O, Kevin Wolf, 2016/06/14
- [Qemu-block] [PATCH v2 1/6] block: Byte-based bdrv_co_do_copy_on_readv(), Kevin Wolf, 2016/06/14
- [Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev, Kevin Wolf, 2016/06/14
- Re: [Qemu-block] [PATCH v2 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev,
Eric Blake <=
- [Qemu-block] [PATCH v2 4/6] raw-posix: Switch to bdrv_co_* interfaces, Kevin Wolf, 2016/06/14
- [Qemu-block] [PATCH v2 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests, Kevin Wolf, 2016/06/14
- [Qemu-block] [PATCH v2 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests, Kevin Wolf, 2016/06/14
- [Qemu-block] [PATCH v2 6/6] block: Don't enforce 512 byte minimum alignment, Kevin Wolf, 2016/06/14
- Re: [Qemu-block] [PATCH v2 0/6] block: Enable byte granularity I/O, Stefan Hajnoczi, 2016/06/15