diff mbox series

[01/13] block: add bdev_max_segments() helper

Message ID b4401816e33a90b1f05a1e32b420f073a8438591.1657321126.git.naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs: zoned: fix active zone tracking issues | expand

Commit Message

Naohiro Aota July 8, 2022, 11:18 p.m. UTC
Add bdev_max_segments() like other queue parameters.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 include/linux/blkdev.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jens Axboe July 9, 2022, 4:10 p.m. UTC | #1
On 7/8/22 5:18 PM, Naohiro Aota wrote:
> Add bdev_max_segments() like other queue parameters.

Reviewed-by: Jens Axboe <axboe@kernel.dk>
Christoph Hellwig July 11, 2022, 7 a.m. UTC | #2
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2f7b43444c5f..62e3ff52ab03 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1206,6 +1206,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;