From: Naohiro Aota Date: Fri, 8 Jul 2022 23:18:38 +0000 (+0900) Subject: block: add bdev_max_segments() helper X-Git-Tag: v5.18.18~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bbb769908a67c955a94e1da57121f96d6809251;p=thirdparty%2Fkernel%2Fstable.git block: add bdev_max_segments() helper [ Upstream commit 65ea1b66482f415d51cd46515b02477257330339 ] Add bdev_max_segments() like other queue parameters. Reviewed-by: Johannes Thumshirn Reviewed-by: Jens Axboe Reviewed-by: Christoph Hellwig Signed-off-by: Naohiro Aota Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 34f2b88dfd6ef..7927480b9cf7c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -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;