diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-05 21:32:23 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 21:41:38 +0200 |
commit | 3a5e02ced11e22ecd9da3d6710afe15bcfee1d10 (patch) | |
tree | 78f6d1a737b01b559b61310b9355f1f7ecfdd54c /drivers/block/loop.c | |
parent | block, fs, drivers: remove REQ_OP compat defs and related code (diff) | |
download | linux-3a5e02ced11e22ecd9da3d6710afe15bcfee1d10.tar.xz linux-3a5e02ced11e22ecd9da3d6710afe15bcfee1d10.zip |
block, drivers: add REQ_OP_FLUSH operation
This adds a REQ_OP_FLUSH operation that is sent to request_fn
based drivers by the block layer's flush code, instead of
sending requests with the request->cmd_flags REQ_FLUSH bit set.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index b9b737cafd5f..364d491d4bdd 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -542,7 +542,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq) pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset; if (op_is_write(req_op(rq))) { - if (rq->cmd_flags & REQ_FLUSH) + if (req_op(rq) == REQ_OP_FLUSH) ret = lo_req_flush(lo, rq); else if (req_op(rq) == REQ_OP_DISCARD) ret = lo_discard(lo, rq, pos); @@ -1659,7 +1659,7 @@ static int loop_queue_rq(struct blk_mq_hw_ctx *hctx, if (lo->lo_state != Lo_bound) return -EIO; - if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) || + if (lo->use_dio && (req_op(cmd->rq) != REQ_OP_FLUSH || req_op(cmd->rq) == REQ_OP_DISCARD)) cmd->use_aio = true; else |