Skip to content

Commit 2fe7b42

Browse files
committed
nvme: fix multipath batched completion accounting
Batched completions were missing the io stats accounting and bio trace events. Move the common code to a helper and call it from the batched and non-batched functions. Fixes: d4d957b ("nvme-multipath: support io stats on the mpath device") Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent d3a0437 commit 2fe7b42

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/nvme/host/core.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ static inline void nvme_end_req_zoned(struct request *req)
414414
}
415415
}
416416

417+
static inline void __nvme_end_req(struct request *req)
418+
{
419+
nvme_end_req_zoned(req);
420+
nvme_trace_bio_complete(req);
421+
if (req->cmd_flags & REQ_NVME_MPATH)
422+
nvme_mpath_end_request(req);
423+
}
424+
417425
static inline void nvme_end_req(struct request *req)
418426
{
419427
blk_status_t status = nvme_error_status(nvme_req(req)->status);
@@ -424,10 +432,7 @@ static inline void nvme_end_req(struct request *req)
424432
else
425433
nvme_log_error(req);
426434
}
427-
nvme_end_req_zoned(req);
428-
nvme_trace_bio_complete(req);
429-
if (req->cmd_flags & REQ_NVME_MPATH)
430-
nvme_mpath_end_request(req);
435+
__nvme_end_req(req);
431436
blk_mq_end_request(req, status);
432437
}
433438

@@ -476,7 +481,7 @@ void nvme_complete_batch_req(struct request *req)
476481
{
477482
trace_nvme_complete_rq(req);
478483
nvme_cleanup_cmd(req);
479-
nvme_end_req_zoned(req);
484+
__nvme_end_req(req);
480485
}
481486
EXPORT_SYMBOL_GPL(nvme_complete_batch_req);
482487

0 commit comments

Comments
 (0)