block: blkg_destroy_all() should clear q->root_blkg and ->root_rl.blkg
[cascardo/linux.git] / block / blk-mq-tag.h
index 75893a3..9eb2cf4 100644 (file)
@@ -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