Christoph Hellwig cf0fbf894b block: add a bdev_max_discard_sectors helper
Add a helper to query the number of sectors support per each discard bio
based on the block device and use this helper to stop various places from
poking into the request_queue to see if discard is supported and if so how
much.  This mirrors what is done e.g. for write zeroes as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com> [drbd]
Acked-by: Coly Li <colyli@suse.de> [bcache]
Acked-by: David Sterba <dsterba@suse.com> [btrfs]
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-24-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-04-17 19:49:59 -06:00
..
2022-02-12 06:20:46 -08:00
2022-03-22 18:26:56 -07:00
2022-03-17 09:16:22 -07:00
2022-03-22 10:00:31 -07:00
2022-03-22 18:26:56 -07:00
2022-03-17 09:16:22 -07:00
2021-03-30 18:48:56 -07:00
2021-12-10 15:48:30 -08:00
2021-08-23 10:25:51 -07:00
2022-03-22 10:00:31 -07:00
2022-03-22 10:00:31 -07:00
2022-03-22 10:00:31 -07:00