On Sun, 02/12 02:47, Max Reitz wrote: > Defining BDRV_REQUEST_MAX_SECTORS based on BDRV_REQUEST_MAX_BYTES is > simpler than the other way around. > > Signed-off-by: Max Reitz <[email protected]> > --- > include/block/block.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/block/block.h b/include/block/block.h > index 4e81f2069b..101ef33f6b 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -114,9 +114,8 @@ typedef struct HDGeometry { > #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) > #define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) > > -#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ > - INT_MAX >> BDRV_SECTOR_BITS) > -#define BDRV_REQUEST_MAX_BYTES (BDRV_REQUEST_MAX_SECTORS << BDRV_SECTOR_BITS) > +#define BDRV_REQUEST_MAX_BYTES MIN(SIZE_MAX, INT_MAX) > +#define BDRV_REQUEST_MAX_SECTORS (BDRV_REQUEST_MAX_BYTES >> > BDRV_SECTOR_BITS) > > /* > * Allocation status flags > -- > 2.11.0 > >
Reviewed-by: Fam Zheng <[email protected]>
