aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-06-16 09:35:39 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-06-23 11:10:39 -0400
commitfd61af0384014ca29428ace7c17a978b755aeddd (patch)
treec7aa5ca9b91383b7c97199189214fa86a6a51b4f /block/cfq-iosched.c
parentcaaa5f9f0a75d1dc5e812e69afdbb8720e077fd3 (diff)
[PATCH] cfq-iosched: rq update fixes
- Remember to set ->last_sector so that the cfq_choose_req() logic works correctly. - Remove redundant call to cfq_choose_req() Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 13c4793fdf5f..940364edf2b9 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -952,11 +952,15 @@ static void cfq_dispatch_insert(request_queue_t *q, struct cfq_rq *crq)
952{ 952{
953 struct cfq_data *cfqd = q->elevator->elevator_data; 953 struct cfq_data *cfqd = q->elevator->elevator_data;
954 struct cfq_queue *cfqq = crq->cfq_queue; 954 struct cfq_queue *cfqq = crq->cfq_queue;
955 struct request *rq;
955 956
956 cfqq->next_crq = cfq_find_next_crq(cfqd, cfqq, crq); 957 cfqq->next_crq = cfq_find_next_crq(cfqd, cfqq, crq);
957 cfq_remove_request(crq->request); 958 cfq_remove_request(crq->request);
958 cfqq->on_dispatch[cfq_crq_is_sync(crq)]++; 959 cfqq->on_dispatch[cfq_crq_is_sync(crq)]++;
959 elv_dispatch_sort(q, crq->request); 960 elv_dispatch_sort(q, crq->request);
961
962 rq = list_entry(q->queue_head.prev, struct request, queuelist);
963 cfqd->last_sector = rq->sector + rq->nr_sectors;
960} 964}
961 965
962/* 966/*
@@ -1767,11 +1771,7 @@ static void
1767cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, 1771cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1768 struct cfq_rq *crq) 1772 struct cfq_rq *crq)
1769{ 1773{
1770 struct cfq_io_context *cic; 1774 struct cfq_io_context *cic = crq->io_context;
1771
1772 cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq);
1773
1774 cic = crq->io_context;
1775 1775
1776 /* 1776 /*
1777 * we never wait for an async request and we don't allow preemption 1777 * we never wait for an async request and we don't allow preemption