Since it is nontrivial to figure out how disk_zone_is_seq() and blk_rq_zone_is_seq() handle sequential write preferred zones, document this. Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- include/linux/blk-mq.h | 7 +++++++ include/linux/blkdev.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 779fba613bd0..6735db1ad24d 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -1155,6 +1155,13 @@ static inline unsigned int blk_rq_zone_no(struct request *rq) return disk_zone_no(rq->q->disk, blk_rq_pos(rq)); } +/** + * blk_rq_zone_is_seq() - Whether a request is for a sequential zone. + * @rq: Request pointer. + * + * Return: true if and only if blk_rq_pos(@rq) refers either to a sequential + * write required or to a sequential write preferred zone. + */ static inline unsigned int blk_rq_zone_is_seq(struct request *rq) { return disk_zone_is_seq(rq->q->disk, blk_rq_pos(rq)); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index b87ed829ab94..ef93e848b1fd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -672,6 +672,15 @@ static inline unsigned int disk_zone_no(struct gendisk *disk, sector_t sector) return sector >> ilog2(disk->queue->limits.chunk_sectors); } +/** + * disk_zone_is_seq() - Whether a logical block is in a sequential zone. + * @disk: Disk pointer. + * @sector: Offset from start of block device in 512 byte units. + * + * Return: true if and only if @disk refers to a zoned block device and + * @sector refers either to a sequential write required or a sequential + * write preferred zone. + */ static inline bool disk_zone_is_seq(struct gendisk *disk, sector_t sector) { if (!blk_queue_is_zoned(disk->queue))