On 6/14/22 11:49 AM, Bart Van Assche wrote: > Introduce a function that makes it easy to verify whether a write > request is for a sequential write required or sequential write preferred > zone. > > Cc: Damien Le Moal <damien.lemoal@xxxxxxx> > Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> > --- > include/linux/blk-mq.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index e2d9daf7e8dd..3e7feb48105f 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -1129,6 +1129,15 @@ static inline unsigned int blk_rq_zone_is_seq(struct request *rq) > return blk_queue_zone_is_seq(rq->q, blk_rq_pos(rq)); > } > > +/** > + * blk_rq_is_seq_write() - Whether @rq is a write request for a sequential zone. > + * @rq: Request to examine. > + */ > +static inline bool blk_rq_is_seq_write(struct request *rq) > +{ > + return req_op(rq) == REQ_OP_WRITE && blk_rq_zone_is_seq(rq); > +} This should include something telling us it's a zone thing, because it sounds generic. blk_rq_is_zoned_seq_write()? -- Jens Axboe