block: cleanup remaining manual checks for PREFLUSH|FUA
authorJens Axboe <axboe@fb.com>
Fri, 27 Jan 2017 16:08:23 +0000 (09:08 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 27 Jan 2017 16:08:23 +0000 (09:08 -0700)
Use op_is_flush() where applicable.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-mq-sched.c

index 4bfd8674afd03124c68cd435356331a5b707a1d7..02833ce5664ea4e59209a93ad82ff0d1f62e8f74 100644 (file)
@@ -1880,7 +1880,7 @@ generic_make_request_checks(struct bio *bio)
         * drivers without flush support don't have to worry
         * about them.
         */
-       if ((bio->bi_opf & (REQ_PREFLUSH | REQ_FUA)) &&
+       if (op_is_flush(bio->bi_opf) &&
            !test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
                bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
                if (!nr_sectors) {
index 1112752f888d0ae1fc5ecb1aa255447e16fc26ea..114814ec3d49f4cd17ebd006adffcec4151cbb99 100644 (file)
@@ -358,7 +358,7 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head,
        struct blk_mq_ctx *ctx = rq->mq_ctx;
        struct blk_mq_hw_ctx *hctx = blk_mq_map_queue(q, ctx->cpu);
 
-       if (rq->tag == -1 && (rq->cmd_flags & (REQ_PREFLUSH | REQ_FUA))) {
+       if (rq->tag == -1 && op_is_flush(rq->cmd_flags)) {
                blk_mq_sched_insert_flush(hctx, rq, can_block);
                return;
        }