aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 7e13f04b5ed4..20a54b8e03e1 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2446,12 +2446,22 @@ static void cfq_exit_queue(struct elevator_queue *e)
2446static void *cfq_init_queue(struct request_queue *q) 2446static void *cfq_init_queue(struct request_queue *q)
2447{ 2447{
2448 struct cfq_data *cfqd; 2448 struct cfq_data *cfqd;
2449 int i;
2449 2450
2450 cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node); 2451 cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node);
2451 if (!cfqd) 2452 if (!cfqd)
2452 return NULL; 2453 return NULL;
2453 2454
2454 cfqd->service_tree = CFQ_RB_ROOT; 2455 cfqd->service_tree = CFQ_RB_ROOT;
2456
2457 /*
2458 * Not strictly needed (since RB_ROOT just clears the node and we
2459 * zeroed cfqd on alloc), but better be safe in case someone decides
2460 * to add magic to the rb code
2461 */
2462 for (i = 0; i < CFQ_PRIO_LISTS; i++)
2463 cfqd->prio_trees[i] = RB_ROOT;
2464
2455 INIT_LIST_HEAD(&cfqd->cic_list); 2465 INIT_LIST_HEAD(&cfqd->cic_list);
2456 2466
2457 cfqd->queue = q; 2467 cfqd->queue = q;