Skip to content

Commit

Permalink
block: move flush initialization to blk_flush_init
Browse files Browse the repository at this point in the history
These fields are always used with the flush request, so
initialize them together.

Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Sep 25, 2014
1 parent f355265 commit 3c09676
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,6 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
#ifdef CONFIG_BLK_CGROUP
INIT_LIST_HEAD(&q->blkg_list);
#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);

kobject_init(&q->kobj, &blk_queue_ktype);
Expand Down
4 changes: 4 additions & 0 deletions block/blk-flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ static int blk_mq_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)
return blk_mq_init_flush(q);

Expand Down

0 comments on commit 3c09676

Please sign in to comment.