aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-04-23 06:13:27 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-24 02:54:22 -0400
commit26a2ac009c2b07e1959c8864ca23486c1c485587 (patch)
treef3c0ae95578cd454f04dc48226b3b6f1ebd1d345
parent17d5c8ca7572124c9623045f24b0c21d4aa2b47f (diff)
cfq-iosched: clear ->prio_trees[] on cfqd alloc
Not strictly needed, but we should make it clear that we init the rbtree roots here. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-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;