Commit 2fe7b422 authored by Keith Busch's avatar Keith Busch

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: d4d957b5 ("nvme-multipath: support io stats on the mpath device")
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent d3a04373
...@@ -414,6 +414,14 @@ static inline void nvme_end_req_zoned(struct request *req) ...@@ -414,6 +414,14 @@ static inline void nvme_end_req_zoned(struct request *req)
} }
} }
static inline void __nvme_end_req(struct request *req)
{
nvme_end_req_zoned(req);
nvme_trace_bio_complete(req);
if (req->cmd_flags & REQ_NVME_MPATH)
nvme_mpath_end_request(req);
}
static inline void nvme_end_req(struct request *req) static inline void nvme_end_req(struct request *req)
{ {
blk_status_t status = nvme_error_status(nvme_req(req)->status); blk_status_t status = nvme_error_status(nvme_req(req)->status);
...@@ -424,10 +432,7 @@ static inline void nvme_end_req(struct request *req) ...@@ -424,10 +432,7 @@ static inline void nvme_end_req(struct request *req)
else else
nvme_log_error(req); nvme_log_error(req);
} }
nvme_end_req_zoned(req); __nvme_end_req(req);
nvme_trace_bio_complete(req);
if (req->cmd_flags & REQ_NVME_MPATH)
nvme_mpath_end_request(req);
blk_mq_end_request(req, status); blk_mq_end_request(req, status);
} }
...@@ -476,7 +481,7 @@ void nvme_complete_batch_req(struct request *req) ...@@ -476,7 +481,7 @@ void nvme_complete_batch_req(struct request *req)
{ {
trace_nvme_complete_rq(req); trace_nvme_complete_rq(req);
nvme_cleanup_cmd(req); nvme_cleanup_cmd(req);
nvme_end_req_zoned(req); __nvme_end_req(req);
} }
EXPORT_SYMBOL_GPL(nvme_complete_batch_req); EXPORT_SYMBOL_GPL(nvme_complete_batch_req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment