[PATCH 04/15] block: add an API to atomically update queue limits
Damien Le Moal
dlemoal at kernel.org
Sun Feb 11 23:24:39 PST 2024
On 2/12/24 15:45, Christoph Hellwig wrote:
> 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 at lst.de>
> ---
> block/blk-core.c | 1 +
> block/blk-settings.c | 228 ++++++++++++++++++++++++++++++++++-------
> block/blk.h | 4 +-
> include/linux/blkdev.h | 23 +++++
> 4 files changed, 218 insertions(+), 38 deletions(-)
[...]
> + /*
> + * Random default for the maximum number of sectors. Driver should not
s/sectors/segments ?
> + * rely on this and set their own.
> + */
> + if (!lim->max_segments)
> + lim->max_segments = BLK_MAX_SEGMENTS;
Other than the above, looks OK to me.
Reviewed-by: Damien Le Moal <dlemoal at kernel.org>
--
Damien Le Moal
Western Digital Research
More information about the Linux-nvme
mailing list