aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 15:32:13 -0400
committerJens Axboe <axboe@fb.com>2016-06-07 15:41:38 -0400
commitba568ea0a2ef9a193ca24874228474ec7ae2ff98 (patch)
tree6e8644ecf525f06c987760705fca60063fe90666 /block
parentcc6e3b10920b425f0b34d4ff75c63d930aaf14ce (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')
-rw-r--r--block/blk-core.c2
-rw-r--r--block/cfq-iosched.c4
-rw-r--r--block/elevator.c7
3 files changed, 6 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index a68dc0709299..090e55d7cad7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1081,7 +1081,7 @@ static struct request *__get_request(struct request_list *rl, int op,
1081 if (unlikely(blk_queue_dying(q))) 1081 if (unlikely(blk_queue_dying(q)))
1082 return ERR_PTR(-ENODEV); 1082 return ERR_PTR(-ENODEV);
1083 1083
1084 may_queue = elv_may_queue(q, op | op_flags); 1084 may_queue = elv_may_queue(q, op, op_flags);
1085 if (may_queue == ELV_MQUEUE_NO) 1085 if (may_queue == ELV_MQUEUE_NO)
1086 goto rq_starved; 1086 goto rq_starved;
1087 1087
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4a349787bc62..3fcc5986c01d 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -4285,7 +4285,7 @@ static inline int __cfq_may_queue(struct cfq_queue *cfqq)
4285 return ELV_MQUEUE_MAY; 4285 return ELV_MQUEUE_MAY;
4286} 4286}
4287 4287
4288static int cfq_may_queue(struct request_queue *q, int rw) 4288static int cfq_may_queue(struct request_queue *q, int op, int op_flags)
4289{ 4289{
4290 struct cfq_data *cfqd = q->elevator->elevator_data; 4290 struct cfq_data *cfqd = q->elevator->elevator_data;
4291 struct task_struct *tsk = current; 4291 struct task_struct *tsk = current;
@@ -4302,7 +4302,7 @@ static int cfq_may_queue(struct request_queue *q, int rw)
4302 if (!cic) 4302 if (!cic)
4303 return ELV_MQUEUE_MAY; 4303 return ELV_MQUEUE_MAY;
4304 4304
4305 cfqq = cic_to_cfqq(cic, rw_is_sync(rw)); 4305 cfqq = cic_to_cfqq(cic, rw_is_sync(op | op_flags));
4306 if (cfqq) { 4306 if (cfqq) {
4307 cfq_init_prio_data(cfqq, cic); 4307 cfq_init_prio_data(cfqq, cic);
4308 4308
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
720int elv_may_queue(struct request_queue *q, int rw) 719int 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}