From: Ming Lei <ming.lei@canonical.com>
To: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@canonical.com>
Subject: [PATCH v4 06/10] block: remove blk_init_flush() and its pair
Date: Mon, 15 Sep 2014 21:11:10 +0800 [thread overview]
Message-ID: <1410786675-7761-7-git-send-email-ming.lei@canonical.com> (raw)
In-Reply-To: <1410786675-7761-1-git-send-email-ming.lei@canonical.com>
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>
---
block/blk-core.c | 5 +++--
block/blk-flush.c | 19 ++-----------------
block/blk-mq.c | 3 ++-
block/blk-sysfs.c | 2 +-
block/blk.h | 4 ++--
5 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index d278a30..e55a8eb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -703,7 +703,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))
@@ -739,7 +740,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);
diff --git a/block/blk-flush.c b/block/blk-flush.c
index db269d4..a464b18 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -481,8 +481,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);
@@ -513,22 +512,8 @@ 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)
{
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);
-}
diff --git a/block/blk-mq.c b/block/blk-mq.c
index a819af4..beea082 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1844,7 +1844,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);
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 28d3a11..571cd34 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -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);
diff --git a/block/blk.h b/block/blk.h
index 2637349..d514e3c 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -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);
--
1.7.9.5
next prev parent reply other threads:[~2014-09-15 13:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 13:11 [PATCH v4 0/10] block: per-distpatch_queue flush machinery Ming Lei
2014-09-15 13:11 ` [PATCH v4 01/10] blk-mq: allocate flush_rq in blk_mq_init_flush() Ming Lei
2014-09-15 13:11 ` [PATCH v4 02/10] block: introduce blk_init_flush and its pair Ming Lei
2014-09-24 10:18 ` Christoph Hellwig
2014-09-24 14:46 ` Ming Lei
2014-09-15 13:11 ` [PATCH v4 03/10] block: move flush initialization to blk_flush_init Ming Lei
2014-09-15 13:11 ` [PATCH v4 04/10] block: avoid to use q->flush_rq directly Ming Lei
2014-09-15 13:11 ` [PATCH v4 05/10] block: introduce blk_flush_queue to drive flush machinery Ming Lei
2014-09-15 13:11 ` Ming Lei [this message]
2014-09-24 10:20 ` [PATCH v4 06/10] block: remove blk_init_flush() and its pair Christoph Hellwig
2014-09-24 14:49 ` Ming Lei
2014-09-24 14:54 ` Christoph Hellwig
2014-09-15 13:11 ` [PATCH v4 07/10] block: flush: avoid to figure out flush queue unnecessarily Ming Lei
2014-09-15 13:11 ` [PATCH v4 08/10] block: introduce 'blk_mq_ctx' parameter to blk_get_flush_queue Ming Lei
2014-09-24 10:21 ` Christoph Hellwig
2014-09-24 14:56 ` Ming Lei
2014-09-15 13:11 ` [PATCH v4 09/10] blk-mq: handle failure path for initializing hctx Ming Lei
2014-09-24 10:22 ` Christoph Hellwig
2014-09-24 14:17 ` Jens Axboe
2014-09-24 15:01 ` Ming Lei
2014-09-24 15:03 ` Christoph Hellwig
2014-09-15 13:11 ` [PATCH v4 10/10] blk-mq: support per-distpatch_queue flush machinery Ming Lei
2014-09-24 10:26 ` Christoph Hellwig
2014-09-24 15:21 ` Ming Lei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410786675-7761-7-git-send-email-ming.lei@canonical.com \
--to=ming.lei@canonical.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®