[PATCH 4/5] blk-mq: kill blk_mq_finish_request
From: Christoph Hellwig
Date: Sun Oct 06 2013 - 11:24:20 EST
It can be merged into the only caller, and doing so allows accounting for
I/O completion in the correct place as well.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
block/blk-mq.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index c137541..99a600e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -284,11 +284,13 @@ static void blk_mq_bio_endio(struct request *rq, struct bio *bio, int error)
bio_endio(bio, error);
}
-static void blk_mq_finish_request(struct request *rq, int error)
+void blk_mq_complete_request(struct request *rq, int error)
{
struct bio *bio = rq->bio;
unsigned int bytes = 0;
+ trace_block_rq_complete(rq->q, rq);
+
while (bio) {
struct bio *next = bio->bi_next;
@@ -299,19 +301,13 @@ static void blk_mq_finish_request(struct request *rq, int error)
}
blk_account_io_completion(rq, bytes);
- blk_account_io_done(rq);
-}
-
-void blk_mq_complete_request(struct request *rq, int error)
-{
- trace_block_rq_complete(rq->q, rq);
-
- blk_mq_finish_request(rq, error);
if (rq->end_io)
rq->end_io(rq, error);
else
blk_mq_free_request(rq);
+
+ blk_account_io_done(rq);
}
void __blk_mq_end_io(struct request *rq, int error)
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/