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.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index f4e1006c253d..b399c62936e0 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1142,6 +1142,17 @@ static void cfq_put_queue(struct cfq_queue *cfqq)
1142 kmem_cache_free(cfq_pool, cfqq); 1142 kmem_cache_free(cfq_pool, cfqq);
1143} 1143}
1144 1144
1145static void
1146__call_for_each_cic(struct io_context *ioc,
1147 void (*func)(struct io_context *, struct cfq_io_context *))
1148{
1149 struct cfq_io_context *cic;
1150 struct hlist_node *n;
1151
1152 hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
1153 func(ioc, cic);
1154}
1155
1145/* 1156/*
1146 * Call func for each cic attached to this ioc. 1157 * Call func for each cic attached to this ioc.
1147 */ 1158 */
@@ -1149,12 +1160,8 @@ static void
1149call_for_each_cic(struct io_context *ioc, 1160call_for_each_cic(struct io_context *ioc,
1150 void (*func)(struct io_context *, struct cfq_io_context *)) 1161 void (*func)(struct io_context *, struct cfq_io_context *))
1151{ 1162{
1152 struct cfq_io_context *cic;
1153 struct hlist_node *n;
1154
1155 rcu_read_lock(); 1163 rcu_read_lock();
1156 hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list) 1164 __call_for_each_cic(ioc, func);
1157 func(ioc, cic);
1158 rcu_read_unlock(); 1165 rcu_read_unlock();
1159} 1166}
1160 1167
@@ -1198,7 +1205,7 @@ static void cfq_free_io_context(struct io_context *ioc)
1198 * should be ok to iterate over the known list, we will see all cic's 1205 * should be ok to iterate over the known list, we will see all cic's
1199 * since no new ones are added. 1206 * since no new ones are added.
1200 */ 1207 */
1201 call_for_each_cic(ioc, cic_free_func); 1208 __call_for_each_cic(ioc, cic_free_func);
1202} 1209}
1203 1210
1204static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq) 1211static void cfq_exit_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq)
@@ -1296,10 +1303,10 @@ static void cfq_init_prio_data(struct cfq_queue *cfqq, struct io_context *ioc)
1296 printk(KERN_ERR "cfq: bad prio %x\n", ioprio_class); 1303 printk(KERN_ERR "cfq: bad prio %x\n", ioprio_class);
1297 case IOPRIO_CLASS_NONE: 1304 case IOPRIO_CLASS_NONE:
1298 /* 1305 /*
1299 * no prio set, place us in the middle of the BE classes 1306 * no prio set, inherit CPU scheduling settings
1300 */ 1307 */
1301 cfqq->ioprio = task_nice_ioprio(tsk); 1308 cfqq->ioprio = task_nice_ioprio(tsk);
1302 cfqq->ioprio_class = IOPRIO_CLASS_BE; 1309 cfqq->ioprio_class = task_nice_ioclass(tsk);
1303 break; 1310 break;
1304 case IOPRIO_CLASS_RT: 1311 case IOPRIO_CLASS_RT:
1305 cfqq->ioprio = task_ioprio(ioc); 1312 cfqq->ioprio = task_ioprio(ioc);