From: Jens Axboe Date: Fri, 27 Jan 2017 16:08:23 +0000 (-0700) Subject: block: cleanup remaining manual checks for PREFLUSH|FUA X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3a8ab7d55bc49b44baa229723e0b5b6ebacac4a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git block: cleanup remaining manual checks for PREFLUSH|FUA Use op_is_flush() where applicable. Signed-off-by: Jens Axboe --- diff --git a/block/blk-core.c b/block/blk-core.c index 4bfd8674afd0..02833ce5664e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -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) { diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 1112752f888d..114814ec3d49 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -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; }