]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] cfq-iosched: rq update fixes
authorJens Axboe <axboe@suse.de>
Fri, 16 Jun 2006 13:35:39 +0000 (15:35 +0200)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Fri, 23 Jun 2006 15:10:39 +0000 (17:10 +0200)
- 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>
block/cfq-iosched.c

index 13c4793fdf5f510d9be80cfbbfb4f5be4b558fa9..940364edf2b96aacbb5c989b458dfd93abd161cd 100644 (file)
@@ -952,11 +952,15 @@ static void cfq_dispatch_insert(request_queue_t *q, struct cfq_rq *crq)
 {
        struct cfq_data *cfqd = q->elevator->elevator_data;
        struct cfq_queue *cfqq = crq->cfq_queue;
+       struct request *rq;
 
        cfqq->next_crq = cfq_find_next_crq(cfqd, cfqq, crq);
        cfq_remove_request(crq->request);
        cfqq->on_dispatch[cfq_crq_is_sync(crq)]++;
        elv_dispatch_sort(q, crq->request);
+
+       rq = list_entry(q->queue_head.prev, struct request, queuelist);
+       cfqd->last_sector = rq->sector + rq->nr_sectors;
 }
 
 /*
@@ -1767,11 +1771,7 @@ static void
 cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
                 struct cfq_rq *crq)
 {
-       struct cfq_io_context *cic;
-
-       cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq);
-
-       cic = crq->io_context;
+       struct cfq_io_context *cic = crq->io_context;
 
        /*
         * we never wait for an async request and we don't allow preemption