aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 3be881ec95ad..5b52011e3a40 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2582,28 +2582,20 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
2582} 2582}
2583 2583
2584/* 2584/*
2585 * Must always be called with the rcu_read_lock() held 2585 * Call func for each cic attached to this ioc.
2586 */ 2586 */
2587static void 2587static void
2588__call_for_each_cic(struct io_context *ioc, 2588call_for_each_cic(struct io_context *ioc,
2589 void (*func)(struct io_context *, struct cfq_io_context *)) 2589 void (*func)(struct io_context *, struct cfq_io_context *))
2590{ 2590{
2591 struct cfq_io_context *cic; 2591 struct cfq_io_context *cic;
2592 struct hlist_node *n; 2592 struct hlist_node *n;
2593 2593
2594 rcu_read_lock();
2595
2594 hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list) 2596 hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
2595 func(ioc, cic); 2597 func(ioc, cic);
2596}
2597 2598
2598/*
2599 * Call func for each cic attached to this ioc.
2600 */
2601static void
2602call_for_each_cic(struct io_context *ioc,
2603 void (*func)(struct io_context *, struct cfq_io_context *))
2604{
2605 rcu_read_lock();
2606 __call_for_each_cic(ioc, func);
2607 rcu_read_unlock(); 2599 rcu_read_unlock();
2608} 2600}
2609 2601
@@ -2664,7 +2656,7 @@ static void cfq_free_io_context(struct io_context *ioc)
2664 * should be ok to iterate over the known list, we will see all cic's 2656 * should be ok to iterate over the known list, we will see all cic's
2665 * since no new ones are added. 2657 * since no new ones are added.
2666 */ 2658 */
2667 __call_for_each_cic(ioc, cic_free_func); 2659 call_for_each_cic(ioc, cic_free_func);
2668} 2660}
2669 2661
2670static void cfq_put_cooperator(struct cfq_queue *cfqq) 2662static void cfq_put_cooperator(struct cfq_queue *cfqq)
@@ -3368,7 +3360,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3368 cfqd->busy_queues > 1) { 3360 cfqd->busy_queues > 1) {
3369 cfq_del_timer(cfqd, cfqq); 3361 cfq_del_timer(cfqd, cfqq);
3370 cfq_clear_cfqq_wait_request(cfqq); 3362 cfq_clear_cfqq_wait_request(cfqq);
3371 __blk_run_queue(cfqd->queue, false); 3363 __blk_run_queue(cfqd->queue);
3372 } else { 3364 } else {
3373 cfq_blkiocg_update_idle_time_stats( 3365 cfq_blkiocg_update_idle_time_stats(
3374 &cfqq->cfqg->blkg); 3366 &cfqq->cfqg->blkg);
@@ -3383,7 +3375,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
3383 * this new queue is RT and the current one is BE 3375 * this new queue is RT and the current one is BE
3384 */ 3376 */
3385 cfq_preempt_queue(cfqd, cfqq); 3377 cfq_preempt_queue(cfqd, cfqq);
3386 __blk_run_queue(cfqd->queue, false); 3378 __blk_run_queue(cfqd->queue);
3387 } 3379 }
3388} 3380}
3389 3381
@@ -3743,7 +3735,7 @@ static void cfq_kick_queue(struct work_struct *work)
3743 struct request_queue *q = cfqd->queue; 3735 struct request_queue *q = cfqd->queue;
3744 3736
3745 spin_lock_irq(q->queue_lock); 3737 spin_lock_irq(q->queue_lock);
3746 __blk_run_queue(cfqd->queue, false); 3738 __blk_run_queue(cfqd->queue);
3747 spin_unlock_irq(q->queue_lock); 3739 spin_unlock_irq(q->queue_lock);
3748} 3740}
3749 3741