[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v4 12/23] block: Convert bdrv_get_b
From: |
John Snow |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v4 12/23] block: Convert bdrv_get_block_status_above() to bytes |
Date: |
Wed, 27 Sep 2017 14:41:04 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/13/2017 12:03 PM, Eric Blake wrote:
> We are gradually moving away from sector-based interfaces, towards
> byte-based. In the common case, allocation is unlikely to ever use
> values that are not naturally sector-aligned, but it is possible
> that byte-based values will let us be more precise about allocation
> at the end of an unaligned file that can do byte-based access.
>
> Changing the name of the function from bdrv_get_block_status_above()
> to bdrv_block_status_above() ensures that the compiler enforces that
> all callers are updated. For now, the io.c layer still assert()s
> that all callers are sector-aligned, but that can be relaxed when a
> later patch implements byte-based block status in the drivers.
>
> For the most part this patch is just the addition of scaling at the
> callers followed by inverse scaling at bdrv_block_status(). But some
> code, particularly bdrv_block_status(), gets a lot simpler because
> it no longer has to mess with sectors. Likewise, mirror code no
> longer computes s->granularity >> BDRV_SECTOR_BITS, and can therefore
> drop an assertion (fix a neighboring assertion to use is_power_of_2
> while there).
>
Huh, I suppose so, yeah. Do you have a test that covers what happens in
this newly available use case?
> For ease of review, bdrv_get_block_status() was tackled separately.
>
> Signed-off-by: Eric Blake <address@hidden>
>
Looks mechanically correct, anyway.
Reviewed-by: John Snow <address@hidden>
- [Qemu-block] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status() to byte-based, (continued)
- [Qemu-block] [PATCH v4 08/23] block: Switch bdrv_co_get_block_status() to byte-based, Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 11/23] block: Switch bdrv_co_get_block_status_above() to byte-based, Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 13/23] qemu-img: Simplify logic in img_compare(), Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 14/23] qemu-img: Speed up compare on pre-allocated larger file, Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 12/23] block: Convert bdrv_get_block_status_above() to bytes, Eric Blake, 2017/09/13
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 12/23] block: Convert bdrv_get_block_status_above() to bytes,
John Snow <=
- [Qemu-block] [PATCH v4 15/23] qemu-img: Add find_nonzero(), Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 16/23] qemu-img: Drop redundant error message in compare, Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 19/23] qemu-img: Change img_rebase() to be byte-based, Eric Blake, 2017/09/13
- [Qemu-block] [PATCH v4 18/23] qemu-img: Change compare_sectors() to be byte-based, Eric Blake, 2017/09/13