diff options
author | Ming Lei <ming.lei@canonical.com> | 2014-09-25 11:23:43 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-25 17:22:40 -0400 |
commit | 7c94e1c157a227837b04f02f5edeff8301410ba2 (patch) | |
tree | 3b592095b0204ebad61dd22b77aa1e72595dbc3a /block/blk-mq.c | |
parent | 7ddab5de5b80d3111f9e6765714e728b2c4f1c07 (diff) |
block: introduce blk_flush_queue to drive flush machinery
This patch introduces 'struct blk_flush_queue' and puts all
flush machinery related fields into this structure, so that
- flush implementation details aren't exposed to driver
- it is easy to convert to per dispatch-queue flush machinery
This patch is basically a mechanical replacement.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 2758cdf2de94..d39e8a5eaeaa 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -508,20 +508,22 @@ void blk_mq_kick_requeue_list(struct request_queue *q) | |||
508 | } | 508 | } |
509 | EXPORT_SYMBOL(blk_mq_kick_requeue_list); | 509 | EXPORT_SYMBOL(blk_mq_kick_requeue_list); |
510 | 510 | ||
511 | static inline bool is_flush_request(struct request *rq, unsigned int tag) | 511 | static inline bool is_flush_request(struct request *rq, |
512 | struct blk_flush_queue *fq, unsigned int tag) | ||
512 | { | 513 | { |
513 | return ((rq->cmd_flags & REQ_FLUSH_SEQ) && | 514 | return ((rq->cmd_flags & REQ_FLUSH_SEQ) && |
514 | rq->q->flush_rq->tag == tag); | 515 | fq->flush_rq->tag == tag); |
515 | } | 516 | } |
516 | 517 | ||
517 | struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag) | 518 | struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag) |
518 | { | 519 | { |
519 | struct request *rq = tags->rqs[tag]; | 520 | struct request *rq = tags->rqs[tag]; |
521 | struct blk_flush_queue *fq = blk_get_flush_queue(rq->q); | ||
520 | 522 | ||
521 | if (!is_flush_request(rq, tag)) | 523 | if (!is_flush_request(rq, fq, tag)) |
522 | return rq; | 524 | return rq; |
523 | 525 | ||
524 | return rq->q->flush_rq; | 526 | return fq->flush_rq; |
525 | } | 527 | } |
526 | EXPORT_SYMBOL(blk_mq_tag_to_rq); | 528 | EXPORT_SYMBOL(blk_mq_tag_to_rq); |
527 | 529 | ||