block: Clarify that @bytes is no limit on *pnum
authorHanna Reitz <hreitz@redhat.com>
Thu, 12 Aug 2021 08:41:45 +0000 (10:41 +0200)
committerHanna Reitz <hreitz@redhat.com>
Wed, 15 Sep 2021 13:54:07 +0000 (15:54 +0200)
commit5a1cfd2150596bddbf429f81097cbd8b861515c0
tree6489c328deb19c4081f66cc89907bfd1dc5d9328
parent0bc329fbb009f8601cec23bf2bc48ead0c5a5fa2
block: Clarify that @bytes is no limit on *pnum

.bdrv_co_block_status() implementations are free to return a *pnum that
exceeds @bytes, because bdrv_co_block_status() in block/io.c will clamp
*pnum as necessary.

On the other hand, if drivers' implementations return values for *pnum
that are as large as possible, our recently introduced block-status
cache will become more effective.

So, make a note in block_int.h that @bytes is no upper limit for *pnum.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210812084148.14458-4-hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
include/block/block_int.h