diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-06-02 11:41:52 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-06-16 15:19:55 +0200 |
commit | 244483e64ee726cc89a1e05bed2be0ed37071403 (patch) | |
tree | a8b9eb61f5d4f2bcfb50f2ff3ee5af97c5d28307 /block/mirror.c | |
parent | 8c0dcbc4ad2bf4f9f3b27c637b357e87cad70ec7 (diff) |
block: Byte-based bdrv_co_do_copy_on_readv()
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 <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/block/mirror.c b/block/mirror.c index 1f01f2488c..41848b2c8e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -185,8 +185,9 @@ static int mirror_cow_align(MirrorBlockJob *s, need_cow |= !test_bit((*sector_num + *nb_sectors - 1) / chunk_sectors, s->cow_bitmap); if (need_cow) { - bdrv_round_to_clusters(blk_bs(s->target), *sector_num, *nb_sectors, - &align_sector_num, &align_nb_sectors); + bdrv_round_sectors_to_clusters(blk_bs(s->target), *sector_num, + *nb_sectors, &align_sector_num, + &align_nb_sectors); } if (align_nb_sectors > max_sectors) { @@ -384,8 +385,9 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) } else if (ret >= 0 && !(ret & BDRV_BLOCK_DATA)) { int64_t target_sector_num; int target_nb_sectors; - bdrv_round_to_clusters(blk_bs(s->target), sector_num, io_sectors, - &target_sector_num, &target_nb_sectors); + bdrv_round_sectors_to_clusters(blk_bs(s->target), sector_num, + io_sectors, &target_sector_num, + &target_nb_sectors); if (target_sector_num == sector_num && target_nb_sectors == io_sectors) { mirror_method = ret & BDRV_BLOCK_ZERO ? |