diff options
author | Ming Lei <ming.lei@canonical.com> | 2014-09-25 11:23:44 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-25 17:22:41 -0400 |
commit | ba483388e3058b3e412632a84e6bf1f134beaf3d (patch) | |
tree | fc54df315e58958208359bd995fdb6df5115dcb2 /block | |
parent | 7c94e1c157a227837b04f02f5edeff8301410ba2 (diff) |
block: remove blk_init_flush() and its pair
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 5 | ||||
-rw-r--r-- | block/blk-flush.c | 19 | ||||
-rw-r--r-- | block/blk-mq.c | 3 | ||||
-rw-r--r-- | block/blk-sysfs.c | 2 | ||||
-rw-r--r-- | block/blk.h | 4 |
5 files changed, 10 insertions, 23 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index cfaca8ca6cc4..dba0a8350807 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -704,7 +704,8 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, | |||
704 | if (!q) | 704 | if (!q) |
705 | return NULL; | 705 | return NULL; |
706 | 706 | ||
707 | if (blk_init_flush(q)) | 707 | q->fq = blk_alloc_flush_queue(q); |
708 | if (!q->fq) | ||
708 | return NULL; | 709 | return NULL; |
709 | 710 | ||
710 | if (blk_init_rl(&q->root_rl, q, GFP_KERNEL)) | 711 | 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, | |||
740 | return q; | 741 | return q; |
741 | 742 | ||
742 | fail: | 743 | fail: |
743 | blk_exit_flush(q); | 744 | blk_free_flush_queue(q->fq); |
744 | return NULL; | 745 | return NULL; |
745 | } | 746 | } |
746 | EXPORT_SYMBOL(blk_init_allocated_queue); | 747 | EXPORT_SYMBOL(blk_init_allocated_queue); |
diff --git a/block/blk-flush.c b/block/blk-flush.c index b01a86d6bf86..d66cbf2b2bc8 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
@@ -479,8 +479,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask, | |||
479 | } | 479 | } |
480 | EXPORT_SYMBOL(blkdev_issue_flush); | 480 | EXPORT_SYMBOL(blkdev_issue_flush); |
481 | 481 | ||
482 | static struct blk_flush_queue *blk_alloc_flush_queue( | 482 | struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q) |
483 | struct request_queue *q) | ||
484 | { | 483 | { |
485 | struct blk_flush_queue *fq; | 484 | struct blk_flush_queue *fq; |
486 | int rq_sz = sizeof(struct request); | 485 | int rq_sz = sizeof(struct request); |
@@ -511,7 +510,7 @@ static struct blk_flush_queue *blk_alloc_flush_queue( | |||
511 | return NULL; | 510 | return NULL; |
512 | } | 511 | } |
513 | 512 | ||
514 | static void blk_free_flush_queue(struct blk_flush_queue *fq) | 513 | void blk_free_flush_queue(struct blk_flush_queue *fq) |
515 | { | 514 | { |
516 | /* bio based request queue hasn't flush queue */ | 515 | /* bio based request queue hasn't flush queue */ |
517 | if (!fq) | 516 | if (!fq) |
@@ -520,17 +519,3 @@ static void blk_free_flush_queue(struct blk_flush_queue *fq) | |||
520 | kfree(fq->flush_rq); | 519 | kfree(fq->flush_rq); |
521 | kfree(fq); | 520 | kfree(fq); |
522 | } | 521 | } |
523 | |||
524 | int blk_init_flush(struct request_queue *q) | ||
525 | { | ||
526 | q->fq = blk_alloc_flush_queue(q); | ||
527 | if (!q->fq) | ||
528 | return -ENOMEM; | ||
529 | |||
530 | return 0; | ||
531 | } | ||
532 | |||
533 | void blk_exit_flush(struct request_queue *q) | ||
534 | { | ||
535 | blk_free_flush_queue(q->fq); | ||
536 | } | ||
diff --git a/block/blk-mq.c b/block/blk-mq.c index d39e8a5eaeaa..59ca79634cb9 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1861,7 +1861,8 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1861 | 1861 | ||
1862 | blk_mq_add_queue_tag_set(set, q); | 1862 | blk_mq_add_queue_tag_set(set, q); |
1863 | 1863 | ||
1864 | if (blk_init_flush(q)) | 1864 | q->fq = blk_alloc_flush_queue(q); |
1865 | if (!q->fq) | ||
1865 | goto err_hw_queues; | 1866 | goto err_hw_queues; |
1866 | 1867 | ||
1867 | blk_mq_map_swqueue(q); | 1868 | blk_mq_map_swqueue(q); |
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 949075952119..718cffc4c678 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -517,7 +517,7 @@ static void blk_release_queue(struct kobject *kobj) | |||
517 | if (q->queue_tags) | 517 | if (q->queue_tags) |
518 | __blk_queue_free_tags(q); | 518 | __blk_queue_free_tags(q); |
519 | 519 | ||
520 | blk_exit_flush(q); | 520 | blk_free_flush_queue(q->fq); |
521 | 521 | ||
522 | if (q->mq_ops) | 522 | if (q->mq_ops) |
523 | blk_mq_free_queue(q); | 523 | blk_mq_free_queue(q); |
diff --git a/block/blk.h b/block/blk.h index 833c4ac6c4eb..9eaa6e91b13f 100644 --- a/block/blk.h +++ b/block/blk.h | |||
@@ -39,8 +39,8 @@ static inline void __blk_get_queue(struct request_queue *q) | |||
39 | kobject_get(&q->kobj); | 39 | kobject_get(&q->kobj); |
40 | } | 40 | } |
41 | 41 | ||
42 | int blk_init_flush(struct request_queue *q); | 42 | struct blk_flush_queue *blk_alloc_flush_queue(struct request_queue *q); |
43 | void blk_exit_flush(struct request_queue *q); | 43 | void blk_free_flush_queue(struct blk_flush_queue *fq); |
44 | 44 | ||
45 | int blk_init_rl(struct request_list *rl, struct request_queue *q, | 45 | int blk_init_rl(struct request_list *rl, struct request_queue *q, |
46 | gfp_t gfp_mask); | 46 | gfp_t gfp_mask); |