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>
This commit is contained in:

committed by
Jens Axboe

parent
d9d8c5c489
commit
c2df40dfb8
@@ -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;
|
||||
|
Reference in New Issue
Block a user