qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v4 11/21] mirror: Switch mirror_cow_align() to b


From: Kevin Wolf
Subject: Re: [Qemu-block] [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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]