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-03-04 12:29:20 -07:00
2022-03-21 16:48:55 -07:00
2022-01-17 07:19:40 -07:00
2022-03-04 12:29:21 -07:00
2021-12-16 10:57:04 -07:00
2022-04-17 19:49:59 -06:00
2021-12-16 10:57:04 -07:00
2022-04-17 19:30:47 -06:00
2021-11-29 06:38:35 -07:00
2022-02-02 07:49:59 -07:00
2021-11-29 06:38:35 -07:00
2021-11-29 06:38:35 -07:00
2022-03-21 17:16:01 -07:00
2022-04-01 16:26:57 -07:00
2021-11-29 06:38:35 -07:00