aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 918920056e42..ebee948293eb 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -546,7 +546,7 @@ void elv_requeue_request(struct request_queue *q, struct request *rq)
546 * in_flight count again 546 * in_flight count again
547 */ 547 */
548 if (blk_account_rq(rq)) { 548 if (blk_account_rq(rq)) {
549 q->in_flight--; 549 q->in_flight[rq_is_sync(rq)]--;
550 if (blk_sorted_rq(rq)) 550 if (blk_sorted_rq(rq))
551 elv_deactivate_rq(q, rq); 551 elv_deactivate_rq(q, rq);
552 } 552 }
@@ -685,7 +685,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where)
685 685
686 if (unplug_it && blk_queue_plugged(q)) { 686 if (unplug_it && blk_queue_plugged(q)) {
687 int nrq = q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC] 687 int nrq = q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC]
688 - q->in_flight; 688 - queue_in_flight(q);
689 689
690 if (nrq >= q->unplug_thresh) 690 if (nrq >= q->unplug_thresh)
691 __generic_unplug_device(q); 691 __generic_unplug_device(q);
@@ -823,7 +823,7 @@ void elv_completed_request(struct request_queue *q, struct request *rq)
823 * request is released from the driver, io must be done 823 * request is released from the driver, io must be done
824 */ 824 */
825 if (blk_account_rq(rq)) { 825 if (blk_account_rq(rq)) {
826 q->in_flight--; 826 q->in_flight[rq_is_sync(rq)]--;
827 if (blk_sorted_rq(rq) && e->ops->elevator_completed_req_fn) 827 if (blk_sorted_rq(rq) && e->ops->elevator_completed_req_fn)
828 e->ops->elevator_completed_req_fn(q, rq); 828 e->ops->elevator_completed_req_fn(q, rq);
829 } 829 }
@@ -838,7 +838,7 @@ void elv_completed_request(struct request_queue *q, struct request *rq)
838 if (!list_empty(&q->queue_head)) 838 if (!list_empty(&q->queue_head))
839 next = list_entry_rq(q->queue_head.next); 839 next = list_entry_rq(q->queue_head.next);
840 840
841 if (!q->in_flight && 841 if (!queue_in_flight(q) &&
842 blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN && 842 blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN &&
843 (!next || blk_ordered_req_seq(next) > QUEUE_ORDSEQ_DRAIN)) { 843 (!next || blk_ordered_req_seq(next) > QUEUE_ORDSEQ_DRAIN)) {
844 blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0); 844 blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0);