]> git.ipfire.org Git - thirdparty/linux.git/commit
block: add a BIO_MAX_SIZE constant and use it
authorChristoph Hellwig <hch@lst.de>
Mon, 26 Jan 2026 05:53:32 +0000 (06:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 28 Jan 2026 12:16:39 +0000 (05:16 -0700)
commitfa0bdd45d7e3703826ea75f5fe3359865d75c319
tree9631195c82427a61778bc56cced354bf26bc1b26
parent7c746eb71fc3737340c32f44c31b111f74f5632c
block: add a BIO_MAX_SIZE constant and use it

Currently the only constant for the maximum bio size is BIO_MAX_SECTORS,
which is in units of 512-byte sectors, but a lot of user need a byte
limit.

Add a BIO_MAX_SIZE constant, redefine BIO_MAX_SECTORS in terms of it, and
switch all bio-related uses of UINT_MAX for the maximum size to use the
symbolic names instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
block/blk-lib.c
block/blk-merge.c
include/linux/blk_types.h