[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid
Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated()
Tue, 4 Jul 2017 15:06:43 +0800
On Mon, 07/03 17:14, Eric Blake wrote:
> @@ -1717,6 +1718,10 @@ int64_t coroutine_fn
> bdrv_co_get_block_status_from_backing(BlockDriverState *bs,
> * Drivers not implementing the functionality are assumed to not support
> * backing files, hence all their sectors are reported as allocated.
> + * If 'allocation' is true, the caller only cares about allocation
> + * status; this is a hint that a larger 'pnum' result is more
> + * important than including BDRV_BLOCK_OFFSET_VALID in the return.
> + *
This is slightly unintuitive. I would guess "allocation == false" means "I don't
care about the allocation status" but it actually is "I don't care about the
consecutiveness". The "only" semantics is missing in the parameter name.
Maybe rename it to "consecutive" and invert the logic? I.e. "consecutive ==
true" means BDRV_BLOCK_OFFSET_VALID is wanted.
Sorry for bikeshedding.
Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated(), Eric Blake, 2017/07/05
[Qemu-block] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status(), Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 04/15] block: Make bdrv_round_to_clusters() signature more useful, Eric Blake, 2017/07/03
[Qemu-block] [PATCH v2 05/15] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/07/03