From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH 1/8] blk-mq: allow drivers to hook into I/O completion
Date: Wed, 16 Apr 2014 09:44:52 +0200 [thread overview]
Message-ID: <1397634299-7466-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1397634299-7466-1-git-send-email-hch@lst.de>
Split out the bottom half of blk_mq_end_io so that drivers can perform
work when they know a request has been completed, but before it has been
freed. This also obsoletes blk_mq_end_io_partial as drivers can now
pass any value to blk_update_request directly.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-mq.c | 16 ++++++++++------
include/linux/blk-mq.h | 9 ++-------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 360a1d9..e921085 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -294,20 +294,24 @@ void blk_mq_clone_flush_request(struct request *flush_rq,
hctx->cmd_size);
}
-bool blk_mq_end_io_partial(struct request *rq, int error, unsigned int nr_bytes)
+inline void __blk_mq_end_io(struct request *rq, int error)
{
- if (blk_update_request(rq, error, blk_rq_bytes(rq)))
- return true;
-
blk_account_io_done(rq);
if (rq->end_io)
rq->end_io(rq, error);
else
blk_mq_free_request(rq);
- return false;
}
-EXPORT_SYMBOL(blk_mq_end_io_partial);
+EXPORT_SYMBOL(__blk_mq_end_io);
+
+void blk_mq_end_io(struct request *rq, int error)
+{
+ if (blk_update_request(rq, error, blk_rq_bytes(rq)))
+ BUG();
+ __blk_mq_end_io(rq, error);
+}
+EXPORT_SYMBOL(blk_mq_end_io);
static void __blk_mq_complete_request_remote(void *data)
{
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index a4ea0ce..a81b474 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -149,13 +149,8 @@ struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_ind
struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_tag_set *, unsigned int);
void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int);
-bool blk_mq_end_io_partial(struct request *rq, int error,
- unsigned int nr_bytes);
-static inline void blk_mq_end_io(struct request *rq, int error)
-{
- bool done = !blk_mq_end_io_partial(rq, error, blk_rq_bytes(rq));
- BUG_ON(!done);
-}
+void blk_mq_end_io(struct request *rq, int error);
+void __blk_mq_end_io(struct request *rq, int error);
void blk_mq_complete_request(struct request *rq);
--
1.7.10.4
next prev parent reply other threads:[~2014-04-16 7:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 7:44 next round of blk-mq updates Christoph Hellwig
2014-04-16 7:44 ` Christoph Hellwig [this message]
2014-04-16 7:44 ` [PATCH 2/8] blk-mq: bidi support Christoph Hellwig
2014-04-16 16:41 ` Jens Axboe
2014-04-16 16:44 ` Christoph Hellwig
2014-04-16 16:45 ` Jens Axboe
2014-04-16 16:47 ` Christoph Hellwig
2014-04-16 16:52 ` Jens Axboe
2014-04-16 7:44 ` [PATCH 3/8] blk-mq: add async paramter to blk_mq_start_stopped_hw_queues Christoph Hellwig
2014-04-16 7:44 ` [PATCH 4/8] blk-mq: add blk_mq_delay_queue Christoph Hellwig
2014-04-16 16:51 ` Jens Axboe
2014-04-16 7:44 ` [PATCH 5/8] blk-mq: add blk_mq_start_hw_queues Christoph Hellwig
2014-04-16 7:44 ` [PATCH 6/8] blk-mq: add blk_mq_requeue_request Christoph Hellwig
2014-04-16 7:44 ` [PATCH 7/8] blk-mq: rename mq_flush_work struct request member Christoph Hellwig
2014-04-16 7:44 ` [PATCH 8/8] block: export blk_finish_request Christoph Hellwig
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=1397634299-7466-2-git-send-email-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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®