if (!q)
return NULL;
- if (blk_init_flush(q))
+ q->fq = blk_alloc_flush_queue(q);
+ if (!q->fq)
return NULL;
if (blk_init_rl(&q->root_rl, q, GFP_KERNEL))
return q;
fail:
- blk_exit_flush(q);
+ blk_free_flush_queue(q->fq);
return NULL;
}
EXPORT_SYMBOL(blk_init_allocated_queue);
}
EXPORT_SYMBOL(blkdev_issue_flush);
-static struct blk_flush_queue *blk_alloc_flush_queue(
- struct request_queue *q)
+struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q)
{
struct blk_flush_queue *fq;
int rq_sz = sizeof(struct request);
return NULL;
}
-static void blk_free_flush_queue(struct blk_flush_queue *fq)
+void blk_free_flush_queue(struct blk_flush_queue *fq)
{
/* bio based request queue hasn't flush queue */
if (!fq)
kfree(fq->flush_rq);
kfree(fq);
}
-
-int blk_init_flush(struct request_queue *q)
-{
- q->fq = blk_alloc_flush_queue(q);
- if (!q->fq)
- return -ENOMEM;
-
- return 0;
-}
-
-void blk_exit_flush(struct request_queue *q)
-{
- blk_free_flush_queue(q->fq);
-}
blk_mq_add_queue_tag_set(set, q);
- if (blk_init_flush(q))
+ q->fq = blk_alloc_flush_queue(q);
+ if (!q->fq)
goto err_hw_queues;
blk_mq_map_swqueue(q);
if (q->queue_tags)
__blk_queue_free_tags(q);
- blk_exit_flush(q);
+ blk_free_flush_queue(q->fq);
if (q->mq_ops)
blk_mq_free_queue(q);
kobject_get(&q->kobj);
}
-int blk_init_flush(struct request_queue *q);
-void blk_exit_flush(struct request_queue *q);
+struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q);
+void blk_free_flush_queue(struct blk_flush_queue *fq);
int blk_init_rl(struct request_list *rl, struct request_queue *q,
gfp_t gfp_mask);