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 <[email protected]> > --- > 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 <[email protected]> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
