block: remove blk_init_flush() and its pair
authorMing Lei <ming.lei@canonical.com>
Thu, 25 Sep 2014 15:23:44 +0000 (23:23 +0800)
committerJens Axboe <axboe@fb.com>
Thu, 25 Sep 2014 21:22:41 +0000 (15:22 -0600)
Now mission of the two helpers is over, and just call
blk_alloc_flush_queue() and blk_free_flush_queue() directly.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-flush.c
block/blk-mq.c
block/blk-sysfs.c
block/blk.h

index cfaca8ca6cc4bde10f372ad61b974bf21f24f643..dba0a8350807fd402d2b110405588141dd93828a 100644 (file)
@@ -704,7 +704,8 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
        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))
@@ -740,7 +741,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
        return q;
 
 fail:
-       blk_exit_flush(q);
+       blk_free_flush_queue(q->fq);
        return NULL;
 }
 EXPORT_SYMBOL(blk_init_allocated_queue);
index b01a86d6bf867f3e33b6843087cdafb553172719..d66cbf2b2bc8daaf83e5597aaf96e5cbdb43505f 100644 (file)
@@ -479,8 +479,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
 }
 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);
@@ -511,7 +510,7 @@ static struct blk_flush_queue *blk_alloc_flush_queue(
        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)
@@ -520,17 +519,3 @@ static void blk_free_flush_queue(struct blk_flush_queue *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);
-}
index d39e8a5eaeaaab0c28e0d36daea18d0886776ace..59ca79634cb9821739777b3eeac3057f68ab2029 100644 (file)
@@ -1861,7 +1861,8 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set)
 
        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);
index 949075952119f83e23600e02b7942ba74e8b857c..718cffc4c678b05df2290e35f6822e926069052b 100644 (file)
@@ -517,7 +517,7 @@ static void blk_release_queue(struct kobject *kobj)
        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);
index 833c4ac6c4eb397f3e5cbaa397b5db72ba6a150e..9eaa6e91b13fa8a98c485e7929a81bf9fae475c8 100644 (file)
@@ -39,8 +39,8 @@ static inline void __blk_get_queue(struct request_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);