[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work i
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated() |
Date: |
Tue, 4 Jul 2017 15:06:43 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
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.
Fam
- [Qemu-devel] [PATCH v2 00/15] make bdrv_get_block_status byte-based, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 01/15] block: add default implementations for bdrv_co_get_block_status(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 04/15] block: Make bdrv_round_to_clusters() signature more useful, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status(), Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 05/15] qcow2: Switch is_zero_sectors() to byte-based, Eric Blake, 2017/07/03
- [Qemu-devel] [PATCH v2 06/15] block: Switch bdrv_make_zero() to byte-based, Eric Blake, 2017/07/03