diff options
author | Christoph Hellwig <hch@lst.de> | 2017-01-27 10:30:47 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-01-27 11:01:45 -0500 |
commit | f73f44eb00cb136990cfb7d40e436c13d7669ec8 (patch) | |
tree | e0a5cc16d9373eec0346538fe073f0c0b08133bf /block/blk-mq.c | |
parent | c13660a08c8b3bb49def4374bfd414aaaa564662 (diff) |
block: add a op_is_flush helper
This centralizes the checks for bios that needs to be go into the flush
state machine.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 301ae29fd229..da2123dd681e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1406,7 +1406,7 @@ insert: | |||
1406 | static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) | 1406 | static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) |
1407 | { | 1407 | { |
1408 | const int is_sync = op_is_sync(bio->bi_opf); | 1408 | const int is_sync = op_is_sync(bio->bi_opf); |
1409 | const int is_flush_fua = bio->bi_opf & (REQ_PREFLUSH | REQ_FUA); | 1409 | const int is_flush_fua = op_is_flush(bio->bi_opf); |
1410 | struct blk_mq_alloc_data data = { .flags = 0 }; | 1410 | struct blk_mq_alloc_data data = { .flags = 0 }; |
1411 | struct request *rq; | 1411 | struct request *rq; |
1412 | unsigned int request_count = 0, srcu_idx; | 1412 | unsigned int request_count = 0, srcu_idx; |
@@ -1527,7 +1527,7 @@ done: | |||
1527 | static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) | 1527 | static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) |
1528 | { | 1528 | { |
1529 | const int is_sync = op_is_sync(bio->bi_opf); | 1529 | const int is_sync = op_is_sync(bio->bi_opf); |
1530 | const int is_flush_fua = bio->bi_opf & (REQ_PREFLUSH | REQ_FUA); | 1530 | const int is_flush_fua = op_is_flush(bio->bi_opf); |
1531 | struct blk_plug *plug; | 1531 | struct blk_plug *plug; |
1532 | unsigned int request_count = 0; | 1532 | unsigned int request_count = 0; |
1533 | struct blk_mq_alloc_data data = { .flags = 0 }; | 1533 | struct blk_mq_alloc_data data = { .flags = 0 }; |