]> www.infradead.org Git - users/hch/misc.git/commit
block: pre-calculate max_zone_append_sectors
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Nov 2024 07:39:32 +0000 (08:39 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Nov 2024 17:34:07 +0000 (10:34 -0700)
commit2a8f6153e1c2db06a537a5c9d61102eb591776f1
treef93e281161726afe8fff817a85c60b62ab4ea2a6
parente494c3dce6981c0b19fee79928b293a1cf0af867
block: pre-calculate max_zone_append_sectors

max_zone_append_sectors differs from all other queue limits in that the
final value used is not stored in the queue_limits but needs to be
obtained using queue_limits_max_zone_append_sectors helper.  This not
only adds (tiny) extra overhead to the I/O path, but also can be easily
forgotten in file system code.

Add a new max_hw_zone_append_sectors value to queue_limits which is
set by the driver, and calculate max_zone_append_sectors from that and
the other inputs in blk_validate_zoned_limits, similar to how
max_sectors is calculated to fix this.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241104073955.112324-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 files changed:
block/blk-core.c
block/blk-merge.c
block/blk-settings.c
block/blk-sysfs.c
drivers/block/null_blk/zoned.c
drivers/block/ublk_drv.c
drivers/block/virtio_blk.c
drivers/md/dm-zone.c
drivers/nvme/host/multipath.c
drivers/nvme/host/zns.c
drivers/scsi/sd_zbc.c
include/linux/blkdev.h