Skip to contentSkip to conversation

nvme: exclude completion trace from non-multipath builds

PATCH New Mikhail Skorzhinskii 2 participants 3 messages Aug 8, 2019 – Aug 15, 2019 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: exclude completion trace from non-multipath builds

This trace point have no meaning without native multipath support and break compilation on configurations without enabled multipath.

Signed-off-by Mikhail Skorzhinskii <mskorzhinskiy at solarflare.com>
---
 drivers/nvme/host/core.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/nvme/host/core.c +15 -4
index 6956041224ec..9fd4397ff158 100644
@@ -260,10 +260,20 @@ static void nvme_retry_req(struct request *req)
 	blk_mq_delay_kick_requeue_list(req->q, delay);
 }
 
+#ifdef CONFIG_NVME_MULTIPATH
+static void nvme_trace_compl(struct request *req, blk_status_t status)
+{
+	struct nvme_ns *ns = req->q->queuedata;
+
+	if (req->bio && ns && ns->head->disk)
+		trace_block_bio_complete(ns->head->disk->queue,
+					 req->bio, status);
+}
+#endif
+
 void nvme_complete_rq(struct request *req)
 {
 	blk_status_t status = nvme_error_status(req);
-	struct nvme_ns *ns = req->q->queuedata;
 
 	trace_nvme_complete_rq(req);
 
@@ -282,9 +292,10 @@ void nvme_complete_rq(struct request *req)
 			return;
 		}
 	}
-	if (req->bio && ns && ns->head->disk)
-		trace_block_bio_complete(ns->head->disk->queue,
-					 req->bio, status);
+
+#ifdef CONFIG_NVME_MULTIPATH
+	nvme_trace_compl(req, status);
+#endif
 	blk_mq_end_request(req, status);
 }
 EXPORT_SYMBOL_GPL(nvme_complete_rq);
Signature · 1 line
2.22.0
maintainer
#1 lore raw

PATCH 1/1 nvme: exclude completion trace from non-multipath builds

Quoted 35 lines · Mikhail Skorzhinskii

This trace point have no meaning without native multipath support and break compilation on configurations without enabled multipath.

Signed-off-by Mikhail Skorzhinskii <mskorzhinskiy at solarflare.com>
---
  drivers/nvme/host/core.c | 19 +++++++++++++++----
  1 file changed, 15 insertions(+), 4 deletions(-)
drivers/nvme/host/core.c +11 -1
index 6956041224ec..9fd4397ff158 100644
@@ -260,10 +260,20 @@ static void nvme_retry_req(struct request *req)
  	blk_mq_delay_kick_requeue_list(req->q, delay);
  }
 
+#ifdef CONFIG_NVME_MULTIPATH
+static void nvme_trace_compl(struct request *req, blk_status_t status)
+{
+	struct nvme_ns *ns = req->q->queuedata;
+
+	if (req->bio && ns && ns->head->disk)
+		trace_block_bio_complete(ns->head->disk->queue,
+					 req->bio, status);
+}
+#endif
+
  void nvme_complete_rq(struct request *req)
  {
  	blk_status_t status = nvme_error_status(req);
-	struct nvme_ns *ns = req->q->queuedata;
 
  	trace_nvme_complete_rq(req);
 

drivers/nvme/host/core.c void nvme_complete_rq(struct request *req) · line 298

Quoted 10 lines
drivers/nvme/host/core.c +4 -3
@@ -282,9 +292,10 @@ void nvme_complete_rq(struct request *req)
  			return;
  		}
  	}
-	if (req->bio && ns && ns->head->disk)
-		trace_block_bio_complete(ns->head->disk->queue,
-					 req->bio, status);
+
+#ifdef CONFIG_NVME_MULTIPATH
+	nvme_trace_compl(req, status);
+#endif

The call should not condition on CONFIG_NVME_MULTIPATH, but the function implementation should be left empty if CONFIG_NVME_MULTIPATH is not enabled (see nvme.h).

Also, lets call it nvme_trace_bio_complete..

maintainer
#2 lore raw

PATCH 1/1 nvme: exclude completion trace from non-multipath builds

Quoted 6 lines

The call should not condition on CONFIG_NVME_MULTIPATH, but the function implementation should be left empty if CONFIG_NVME_MULTIPATH is not enabled (see nvme.h).

Also, lets call it nvme_trace_bio_complete..

Hey Mikhail, are you sending a respin or should I?