Commit 43d15eb2 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] setup queue before elevator_init()

We must setup the queue before calling elevator_init(), otherwise the
elevator cannot use the queue members. This really hurts cfq since it
checks ->nr_requests, which is zero at that time.
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent da58de4b
......@@ -1467,9 +1467,6 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
printk("Using %s io scheduler\n", chosen_elevator->elevator_name);
}
if (elevator_init(q, chosen_elevator))
goto out_elv;
q->request_fn = rfn;
q->back_merge_fn = ll_back_merge_fn;
q->front_merge_fn = ll_front_merge_fn;
......@@ -1487,8 +1484,12 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
return q;
out_elv:
/*
* all done
*/
if (!elevator_init(q, chosen_elevator))
return q;
blk_cleanup_queue(q);
out_init:
kmem_cache_free(requestq_cachep, q);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment