On 11/05/2015 10:02, Fam Zheng wrote: > > /* > * ... > * > * 'pnum' is set to the number of sectors (including and immediately > following > * the specified sector) that are known to be in the same > * allocated/unallocated state. > * > * 'nb_sectors' is the max value 'pnum' should be set to. If > nb_sectors goes > * beyond the end of the disk image it will be clamped. > */ > static int64_t coroutine_fn bdrv_co_get_block_status(BlockDriverState > *bs, > > So we currently don't coalesce the sequential dirty sectors. > > Was that intentional?
The idea, I think, is that for some drivers bdrv_co_get_block_status is O(nb_sectors). It's okay to let a driver return *pnum > nb_sectors. You do need to audit the callers, though. It would be nice also to add TODOs whenever the code is fine but it could explot *pnum > nb_sectors to get better performance. Paolo