block: add an API to atomically update queue limits
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Feb 2024 07:34:14 +0000 (08:34 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 Feb 2024 15:56:59 +0000 (08:56 -0700)
commitd690cb8ae14bd377d422b7905b6959c7e7a45b95
treec909d6c4f74dfd4c69ba78d57aa8d737d9515cf3
parentc490f226a0ea22639e81ac34edc884e238ea955a
block: add an API to atomically update queue limits

Add a new queue_limits_{start,commit}_update pair of functions that
allows taking an atomic snapshot of queue limits, update it, and
commit it if it passes validity checking.  Also use the low-level
validation helper to implement blk_set_default_limits instead of
duplicating the initialization.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20240213073425.1621680-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-settings.c
block/blk.h
include/linux/blkdev.h