summaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorMike Christie2016-06-05 21:32:17 +0200
committerJens Axboe2016-06-07 21:41:38 +0200
commitc2df40dfb8c015211ec55f4b1dd0587f875c7b34 (patch)
tree8660ea8a2a00b0248fa609e7e6b737a8d92306d9 /drivers/block/loop.c
parentblock: convert is_sync helpers to use REQ_OPs. (diff)
downloadkernel-qcow2-linux-c2df40dfb8c015211ec55f4b1dd0587f875c7b34.tar.gz
kernel-qcow2-linux-c2df40dfb8c015211ec55f4b1dd0587f875c7b34.tar.xz
kernel-qcow2-linux-c2df40dfb8c015211ec55f4b1dd0587f875c7b34.zip
drivers: use req op accessor
The req operation REQ_OP is separated from the rq_flag_bits definition. This converts the block layer drivers to use req_op to get the op from the request struct. Signed-off-by: Mike Christie <mchristi@redhat.com> 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index e9f1701af7cb..b9b737cafd5f 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -544,7 +544,7 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
if (op_is_write(req_op(rq))) {
if (rq->cmd_flags & REQ_FLUSH)
ret = lo_req_flush(lo, rq);
- else if (rq->cmd_flags & REQ_DISCARD)
+ else if (req_op(rq) == REQ_OP_DISCARD)
ret = lo_discard(lo, rq, pos);
else if (lo->transfer)
ret = lo_write_transfer(lo, rq, pos);
@@ -1659,8 +1659,8 @@ 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 |
- REQ_DISCARD)))
+ if (lo->use_dio && (!(cmd->rq->cmd_flags & REQ_FLUSH) ||
+ req_op(cmd->rq) == REQ_OP_DISCARD))
cmd->use_aio = true;
else
cmd->use_aio = false;