[PATCH 04/14] nvmet: remove repeated call for fw slot log page

Chaitanya Kulkarni chaitanya.kulkarni at wdc.com
Sun Jun 27 22:08:07 PDT 2021


Return status from nvmet_execute_get_log_page_noop() and complete the
request in nvmet_execute_get_log_page(). This reduces number of
repeated nvmet_req_complete() calls for log page handlers.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 drivers/nvme/target/admin-cmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 079fe04d0ee6..8c798559f1cc 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -40,9 +40,9 @@ u64 nvmet_get_log_page_offset(struct nvme_command *cmd)
 	return le64_to_cpu(cmd->get_log_page.lpo);
 }
 
-static void nvmet_execute_get_log_page_noop(struct nvmet_req *req)
+static u16 nvmet_execute_get_log_page_noop(struct nvmet_req *req)
 {
-	nvmet_req_complete(req, nvmet_zero_sgl(req, 0, req->transfer_len));
+	return nvmet_zero_sgl(req, 0, req->transfer_len);
 }
 
 static u16 nvmet_execute_get_log_page_error(struct nvmet_req *req)
@@ -332,7 +332,8 @@ static void nvmet_execute_get_log_page(struct nvmet_req *req)
 		 * active, so we can zero out the whole firmware slot log and
 		 * still claim to fully implement this mandatory log page.
 		 */
-		return nvmet_execute_get_log_page_noop(req);
+		status = nvmet_execute_get_log_page_noop(req);
+		break;
 	case NVME_LOG_CHANGED_NS:
 		return nvmet_execute_get_log_changed_ns(req);
 	case NVME_LOG_CMD_EFFECTS:
-- 
2.22.1




More information about the Linux-nvme mailing list