On 6/24/22 08:25, Bart Van Assche wrote: > Since it is nontrivial to figure out how blk_queue_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> Looks good. Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> > --- > 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 e2d9daf7e8dd..909d47e34b7c 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -1124,6 +1124,13 @@ static inline unsigned int blk_rq_zone_no(struct request *rq) > return blk_queue_zone_no(rq->q, 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 a sequential write preferred zone. > + */ > static inline unsigned int blk_rq_zone_is_seq(struct request *rq) > { > return blk_queue_zone_is_seq(rq->q, blk_rq_pos(rq)); > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 92b3bffad328..2904100d2485 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -688,6 +688,15 @@ static inline unsigned int blk_queue_zone_no(struct request_queue *q, > return sector >> ilog2(q->limits.chunk_sectors); > } > > +/** > + * blk_queue_zone_is_seq() - Whether a logical block is in a sequential zone. > + * @q: Request queue pointer. > + * @sector: Offset from start of block device in 512 byte units. > + * > + * Return: true if and only if @q is associated with a zoned block device and > + * @sector refers either to a sequential write required or a sequential write > + * preferred zone. > + */ > static inline bool blk_queue_zone_is_seq(struct request_queue *q, > sector_t sector) > { -- Damien Le Moal Western Digital Research