Commit 3c09676c authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

block: move flush initialization to blk_flush_init

These fields are always used with the flush request, so
initialize them together.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent f3552655
...@@ -600,9 +600,6 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) ...@@ -600,9 +600,6 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
#ifdef CONFIG_BLK_CGROUP #ifdef CONFIG_BLK_CGROUP
INIT_LIST_HEAD(&q->blkg_list); INIT_LIST_HEAD(&q->blkg_list);
#endif #endif
INIT_LIST_HEAD(&q->flush_queue[0]);
INIT_LIST_HEAD(&q->flush_queue[1]);
INIT_LIST_HEAD(&q->flush_data_in_flight);
INIT_DELAYED_WORK(&q->delay_work, blk_delay_work); INIT_DELAYED_WORK(&q->delay_work, blk_delay_work);
kobject_init(&q->kobj, &blk_queue_ktype); kobject_init(&q->kobj, &blk_queue_ktype);
......
...@@ -488,6 +488,10 @@ static int blk_mq_init_flush(struct request_queue *q) ...@@ -488,6 +488,10 @@ static int blk_mq_init_flush(struct request_queue *q)
int blk_init_flush(struct request_queue *q) int blk_init_flush(struct request_queue *q)
{ {
INIT_LIST_HEAD(&q->flush_queue[0]);
INIT_LIST_HEAD(&q->flush_queue[1]);
INIT_LIST_HEAD(&q->flush_data_in_flight);
if (q->mq_ops) if (q->mq_ops)
return blk_mq_init_flush(q); return blk_mq_init_flush(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