summaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-04-14 10:30:08 +0200
committerJens Axboe <axboe@fb.com>2014-04-15 14:03:02 -0600
commit8727af4b9d45c7503042e3fbd926c1a173876e9c (patch)
treee6f2d8b7d9808cfbfb0b67a088b182776518a797 /block/blk-flush.c
parent9d74e25737d73e93ccddeb5a61bcd56b7b8eb57b (diff)
downloadlinux-8727af4b9d45c7503042e3fbd926c1a173876e9c.tar.gz
linux-8727af4b9d45c7503042e3fbd926c1a173876e9c.tar.bz2
linux-8727af4b9d45c7503042e3fbd926c1a173876e9c.zip
blk-mq: make ->flush_rq fully transparent to drivers
Drivers shouldn't have to care about the block layer setting aside a request to implement the flush state machine. We already override the mq context and tag to make it more transparent, but so far haven't deal with the driver private data in the request. Make sure to override this as well, and while we're at it add a proper helper sitting in blk-mq.c that implements the full impersonation. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 0e42adcfb55e..c41fc19f75d1 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -307,16 +307,8 @@ static bool blk_kick_flush(struct request_queue *q)
q->flush_pending_idx ^= 1;
blk_rq_init(q, q->flush_rq);
- if (q->mq_ops) {
- /*
- * Reuse the tag value from the fist waiting request,
- * with blk-mq the tag is generated during request
- * allocation and drivers can rely on it being inside
- * the range they asked for.
- */
- q->flush_rq->mq_ctx = first_rq->mq_ctx;
- q->flush_rq->tag = first_rq->tag;
- }
+ if (q->mq_ops)
+ blk_mq_clone_flush_request(q->flush_rq, first_rq);
q->flush_rq->cmd_type = REQ_TYPE_FS;
q->flush_rq->cmd_flags = WRITE_FLUSH | REQ_FLUSH_SEQ;