block: make the flush insertion use the tail of the dispatch list
authorJens Axboe <jaxboe@fusionio.com>
Wed, 30 Mar 2011 11:27:09 +0000 (13:27 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Tue, 5 Apr 2011 21:51:37 +0000 (23:51 +0200)
It's not a preempt type request, in fact we have to insert it
behind requests that do specify INSERT_FRONT.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/blk-flush.c

index d6275cbbaf355d0673132f5f6b0bff7af68c484e..eba4a2790c6c4ba2e0467ca58300050e190d6804 100644 (file)
@@ -261,7 +261,7 @@ static bool blk_kick_flush(struct request_queue *q)
        q->flush_rq.end_io = flush_end_io;
 
        q->flush_pending_idx ^= 1;
-       __elv_add_request(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE);
+       list_add_tail(&q->flush_rq.queuelist, &q->queue_head);
        return true;
 }
 
@@ -312,7 +312,7 @@ void blk_insert_flush(struct request *rq)
         */
        if ((policy & REQ_FSEQ_DATA) &&
            !(policy & (REQ_FSEQ_PREFLUSH | REQ_FSEQ_POSTFLUSH))) {
-               list_add(&rq->queuelist, &q->queue_head);
+               list_add_tail(&rq->queuelist, &q->queue_head);
                return;
        }