On Thu, Apr 24, 2025 at 07:52:03PM -0500, Eric Blake wrote: > Some BDS drivers have a cap on how much block status they can supply > in one query (for example, NBD talking to an older server cannot > inspect more than 4G per query; and qcow2 tends to cap its answers > rather than cross a cluster boundary of an L1 table). Although the > existing callers of bdrv_co_is_zero_fast are not passing in that large > of a 'bytes' parameter, an upcoming caller wants to query the entire > image at once, and will thus benefit from being able to treat adjacent > zero regions in a coalesced manner, rather than claiming the region is > non-zero merely because pnum was truncated and didn't match the > incoming bytes. > > While refactoring this into a loop, note that there is no need to > assign pnum prior to calling bdrv_co_common_block_status_above() (it > is guaranteed to be assigned deeper in the callstack). > > Signed-off-by: Eric Blake <ebl...@redhat.com> > > --- > > v3: also tweak function comment > --- > block/io.c | 29 ++++++++++++++++------------- > 1 file changed, 16 insertions(+), 13 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature