[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] block: Byte-based bdrv_co_do_copy_on_readv(
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] block: Byte-based bdrv_co_do_copy_on_readv() |
Date: |
Wed, 8 Jun 2016 08:25:28 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 06/08/2016 08:10 AM, Kevin Wolf wrote:
> In a first step to convert the common I/O path to work on bytes rather
> than sectors, this converts the copy-on-read logic that is used by
> bdrv_aligned_preadv().
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/io.c | 63
> +++++++++++++++++++++++++++++++--------------------
> block/mirror.c | 10 ++++----
> include/block/block.h | 10 +++++---
> 3 files changed, 51 insertions(+), 32 deletions(-)
>
> @@ -873,21 +893,20 @@ static int coroutine_fn
> bdrv_co_do_copy_on_readv(BlockDriverState *bs,
> BlockDriver *drv = bs->drv;
> struct iovec iov;
> QEMUIOVector bounce_qiov;
> - int64_t cluster_sector_num;
> - int cluster_nb_sectors;
> + int64_t cluster_offset;
> + unsigned int cluster_bytes;
> size_t skip_bytes;
> int ret;
>
> /* Cover entire cluster so no additional backing file I/O is required
> when
> * allocating cluster in the image file.
> */
> - bdrv_round_to_clusters(bs, sector_num, nb_sectors,
> - &cluster_sector_num, &cluster_nb_sectors);
> + bdrv_round_to_clusters(bs, offset, bytes, &cluster_offset,
> &cluster_bytes);
>
> - trace_bdrv_co_do_copy_on_readv(bs, sector_num, nb_sectors,
> - cluster_sector_num, cluster_nb_sectors);
> + trace_bdrv_co_do_copy_on_readv(bs, offset, bytes,
> + cluster_offset, cluster_bytes);
Missing patch to trace-events to advertise new semantics.
With that fixed,
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-devel] [PATCH 0/6] block: Enable byte granularity I/O, Kevin Wolf, 2016/06/08
- [Qemu-devel] [PATCH 2/6] block: Prepare bdrv_aligned_preadv() for byte-aligned requests, Kevin Wolf, 2016/06/08
- [Qemu-devel] [PATCH 1/6] block: Byte-based bdrv_co_do_copy_on_readv(), Kevin Wolf, 2016/06/08
- [Qemu-devel] [PATCH 3/6] block: Prepare bdrv_aligned_pwritev() for byte-aligned requests, Kevin Wolf, 2016/06/08
- [Qemu-devel] [PATCH 5/6] raw-posix: Implement .bdrv_co_preadv/pwritev, Kevin Wolf, 2016/06/08
- [Qemu-devel] [PATCH 4/6] raw-posix: Switch to bdrv_co_* interfaces, Kevin Wolf, 2016/06/08