[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180802174937.15444-2-ming.lei@redhat.com>
Date: Fri, 3 Aug 2018 01:49:36 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org, Ming Lei <ming.lei@...hat.com>,
Josef Bacik <josef@...icpanda.com>,
Christoph Hellwig <hch@....de>,
Guenter Roeck <linux@...ck-us.net>,
Mark Brown <broonie@...nel.org>,
Matt Hart <matthew.hart@...aro.org>,
Johannes Thumshirn <jthumshirn@...e.de>,
John Garry <john.garry@...wei.com>,
Hannes Reinecke <hare@...e.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
James Bottomley <James.Bottomley@...senpartnership.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH V2 1/2] blk-mq: move blk_mq_request_started() into header file
Define it as static inline given it might be called in fast path.
Suggested-by: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Josef Bacik <josef@...icpanda.com>
Cc: Christoph Hellwig <hch@....de>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: Mark Brown <broonie@...nel.org>
Cc: Matt Hart <matthew.hart@...aro.org>
Cc: Johannes Thumshirn <jthumshirn@...e.de>
Cc: John Garry <john.garry@...wei.com>
Cc: Hannes Reinecke <hare@...e.com>,
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>,
Cc: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: linux-scsi@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Ming Lei <ming.lei@...hat.com>
---
block/blk-mq.c | 6 ------
block/blk-mq.h | 9 ---------
include/linux/blk-mq.h | 15 ++++++++++++++-
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index c92ce06fd565..7afd1c925fa8 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -619,12 +619,6 @@ void blk_mq_complete_request(struct request *rq)
}
EXPORT_SYMBOL(blk_mq_complete_request);
-int blk_mq_request_started(struct request *rq)
-{
- return blk_mq_rq_state(rq) != MQ_RQ_IDLE;
-}
-EXPORT_SYMBOL_GPL(blk_mq_request_started);
-
void blk_mq_start_request(struct request *rq)
{
struct request_queue *q = rq->q;
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 9497b47e2526..18bc448b61a3 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -90,15 +90,6 @@ extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
void blk_mq_release(struct request_queue *q);
-/**
- * blk_mq_rq_state() - read the current MQ_RQ_* state of a request
- * @rq: target request.
- */
-static inline enum mq_rq_state blk_mq_rq_state(struct request *rq)
-{
- return READ_ONCE(rq->state);
-}
-
static inline struct blk_mq_ctx *__blk_mq_get_ctx(struct request_queue *q,
unsigned int cpu)
{
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 1da59c16f637..cc0359b83fb8 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -250,7 +250,6 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag)
}
-int blk_mq_request_started(struct request *rq);
void blk_mq_start_request(struct request *rq);
void blk_mq_end_request(struct request *rq, blk_status_t error);
void __blk_mq_end_request(struct request *rq, blk_status_t error);
@@ -303,6 +302,20 @@ static inline bool blk_mq_mark_complete(struct request *rq)
MQ_RQ_IN_FLIGHT;
}
+/**
+ * blk_mq_rq_state() - read the current MQ_RQ_* state of a request
+ * @rq: target request.
+ */
+static inline enum mq_rq_state blk_mq_rq_state(struct request *rq)
+{
+ return READ_ONCE(rq->state);
+}
+
+static inline int blk_mq_request_started(struct request *rq)
+{
+ return blk_mq_rq_state(rq) != MQ_RQ_IDLE;
+}
+
/*
* Driver command data is immediately after the request. So subtract request
* size to get back to the original request, add request size to get the PDU.
--
2.9.5
Powered by blists - more mailing lists