X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=block%2Fblk-mq-tag.h;h=9eb2cf4f01cb874706d64af87a01e94e0121f7e4;hb=90b0fc26d5dbe21c7a21668320b276af9b2281d7;hp=75893a34237d2eb2b4d07bd21a70cc35948c172a;hpb=473e0bc39bd5d2542e90edc622a65bd49206409d;p=firefly-linux-kernel-4.4.55.git diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h index 75893a34237d..9eb2cf4f01cb 100644 --- a/block/blk-mq-tag.h +++ b/block/blk-mq-tag.h @@ -89,4 +89,16 @@ static inline void blk_mq_tag_idle(struct blk_mq_hw_ctx *hctx) __blk_mq_tag_idle(hctx); } +/* + * This helper should only be used for flush request to share tag + * with the request cloned from, and both the two requests can't be + * in flight at the same time. The caller has to make sure the tag + * can't be freed. + */ +static inline void blk_mq_tag_set_rq(struct blk_mq_hw_ctx *hctx, + unsigned int tag, struct request *rq) +{ + hctx->tags->rqs[tag] = rq; +} + #endif