[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 11/21] mirror: Switch mirror_cow_align() to b
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v4 11/21] mirror: Switch mirror_cow_align() to byte-based |
Date: |
Thu, 6 Jul 2017 13:16:54 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 05.07.2017 um 23:08 hat Eric Blake geschrieben:
> We are gradually converting to byte-based interfaces, as they are
> easier to reason about than sector-based. Convert another internal
> function (no semantic change), and add mirror_clip_bytes() as a
> counterpart to mirror_clip_sectors(). Some of the conversion is
> a bit tricky, requiring temporaries to convert between units; it
> will be cleared up in a following patch.
>
> Signed-off-by: Eric Blake <address@hidden>
> Reviewed-by: John Snow <address@hidden>
> Reviewed-by: Jeff Cody <address@hidden>
> - if (align_nb_sectors > max_sectors) {
> - align_nb_sectors = max_sectors;
> + if (align_bytes > max_bytes) {
> + align_bytes = max_bytes;
> if (need_cow) {
> - align_nb_sectors = QEMU_ALIGN_DOWN(align_nb_sectors,
> - s->target_cluster_size >>
> - BDRV_SECTOR_BITS);
> + align_bytes = QEMU_ALIGN_DOWN(align_bytes,
> + s->target_cluster_size);
This would fit in a single line, if you have to respin for some reason.
Reviewed-by: Kevin Wolf <address@hidden>
- [Qemu-devel] [PATCH v4 10/21] mirror: Update signature of mirror_clip_sectors(), (continued)
- [Qemu-devel] [PATCH v4 10/21] mirror: Update signature of mirror_clip_sectors(), Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 06/21] commit: Switch commit_populate() to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 02/21] trace: Show blockjob actions via bytes, not sectors, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 05/21] stream: Switch stream_run() to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 08/21] mirror: Switch MirrorBlockJob to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 09/21] mirror: Switch mirror_do_zero_or_discard() to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 11/21] mirror: Switch mirror_cow_align() to byte-based, Eric Blake, 2017/07/05
- Re: [Qemu-devel] [PATCH v4 11/21] mirror: Switch mirror_cow_align() to byte-based,
Kevin Wolf <=
- [Qemu-devel] [PATCH v4 12/21] mirror: Switch mirror_do_read() to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 13/21] mirror: Switch mirror_iteration() to byte-based, Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 14/21] block: Drop unused bdrv_round_sectors_to_clusters(), Eric Blake, 2017/07/05
- [Qemu-devel] [PATCH v4 15/21] backup: Switch BackupBlockJob to byte-based, Eric Blake, 2017/07/05