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 <[email protected]>
> Reviewed-by: John Snow <[email protected]>
> Reviewed-by: Jeff Cody <[email protected]>
> - 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 <[email protected]>