]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
block: add bdev_max_segments() helper
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 8 Jul 2022 23:18:38 +0000 (08:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:42:25 +0000 (14:42 +0200)
[ Upstream commit 65ea1b66482f415d51cd46515b02477257330339 ]

Add bdev_max_segments() like other queue parameters.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/blkdev.h

index 34f2b88dfd6efa6feb1f2574c38a67d3b52d12d3..7927480b9cf7c4b179d208dfb4469efe1a6ffdee 100644 (file)
@@ -1196,6 +1196,11 @@ bdev_max_zone_append_sectors(struct block_device *bdev)
        return queue_max_zone_append_sectors(bdev_get_queue(bdev));
 }
 
+static inline unsigned int bdev_max_segments(struct block_device *bdev)
+{
+       return queue_max_segments(bdev_get_queue(bdev));
+}
+
 static inline unsigned queue_logical_block_size(const struct request_queue *q)
 {
        int retval = 512;