block: add a max_user_discard_sectors queue limit
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Feb 2024 07:34:16 +0000 (08:34 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 Feb 2024 15:56:59 +0000 (08:56 -0700)
commit4f563a64732dabb2677c7d1232a8f714a18b41b3
tree5b697ef500875bf3bf7776dba05c14cebbb48590
parent0327ca9d53bfbb0918867313049bba7046900f73
block: add a max_user_discard_sectors queue limit

Add a new max_user_discard_sectors limit that mirrors max_user_sectors
and stores the value that the user manually set.  This now allows
updates of the max_hw_discard_sectors to not worry about the user
limit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20240213073425.1621680-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c
block/blk-sysfs.c
include/linux/blkdev.h