diff options
author | Mike Christie <mchristi@redhat.com> | 2016-06-05 15:32:13 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 15:41:38 -0400 |
commit | ba568ea0a2ef9a193ca24874228474ec7ae2ff98 (patch) | |
tree | 6e8644ecf525f06c987760705fca60063fe90666 /block/elevator.c | |
parent | cc6e3b10920b425f0b34d4ff75c63d930aaf14ce (diff) |
block: prepare elevator to use REQ_OPs.
This patch converts the elevator code to use separate variables
for the operation and flags, and to check req_op for the REQ_OP.
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 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index c3555c9c672f..ea9319db50d7 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -366,8 +366,7 @@ void elv_dispatch_sort(struct request_queue *q, struct request *rq) | |||
366 | list_for_each_prev(entry, &q->queue_head) { | 366 | list_for_each_prev(entry, &q->queue_head) { |
367 | struct request *pos = list_entry_rq(entry); | 367 | struct request *pos = list_entry_rq(entry); |
368 | 368 | ||
369 | if ((rq->cmd_flags & REQ_DISCARD) != | 369 | if ((req_op(rq) == REQ_OP_DISCARD) != (req_op(pos) == REQ_OP_DISCARD)) |
370 | (pos->cmd_flags & REQ_DISCARD)) | ||
371 | break; | 370 | break; |
372 | if (rq_data_dir(rq) != rq_data_dir(pos)) | 371 | if (rq_data_dir(rq) != rq_data_dir(pos)) |
373 | break; | 372 | break; |
@@ -717,12 +716,12 @@ void elv_put_request(struct request_queue *q, struct request *rq) | |||
717 | e->type->ops.elevator_put_req_fn(rq); | 716 | e->type->ops.elevator_put_req_fn(rq); |
718 | } | 717 | } |
719 | 718 | ||
720 | int elv_may_queue(struct request_queue *q, int rw) | 719 | int elv_may_queue(struct request_queue *q, int op, int op_flags) |
721 | { | 720 | { |
722 | struct elevator_queue *e = q->elevator; | 721 | struct elevator_queue *e = q->elevator; |
723 | 722 | ||
724 | if (e->type->ops.elevator_may_queue_fn) | 723 | if (e->type->ops.elevator_may_queue_fn) |
725 | return e->type->ops.elevator_may_queue_fn(q, rw); | 724 | return e->type->ops.elevator_may_queue_fn(q, op, op_flags); |
726 | 725 | ||
727 | return ELV_MQUEUE_MAY; | 726 | return ELV_MQUEUE_MAY; |
728 | } | 727 | } |