From 67ac0638eb94313a57b2b8c3fdc03937c2c20627 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 13 May 2021 20:39:14 +0000 Subject: [PATCH] nvmf: make fused status construction easier to understand It is a bit confusing for the variable names to not match the parameter names for spdk_bdev_io_get_nvme_fused_status(). These changes should make it a bit simpler to understand. Signed-off-by: Jim Harris Change-Id: I833bf2a75cfec7b86da2d8a234f800de3510c2b7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9867 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/nvmf/ctrlr_bdev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/nvmf/ctrlr_bdev.c b/lib/nvmf/ctrlr_bdev.c index d301689d51..3dd78f7c87 100644 --- a/lib/nvmf/ctrlr_bdev.c +++ b/lib/nvmf/ctrlr_bdev.c @@ -93,29 +93,29 @@ nvmf_bdev_ctrlr_complete_cmd(struct spdk_bdev_io *bdev_io, bool success, { struct spdk_nvmf_request *req = cb_arg; struct spdk_nvme_cpl *response = &req->rsp->nvme_cpl; - int first_sc = 0, first_sct = 0, second_sc = 0, second_sct = 0; + int first_sc = 0, first_sct = 0, sc = 0, sct = 0; uint32_t cdw0 = 0; struct spdk_nvmf_request *first_req = req->first_fused_req; if (spdk_unlikely(first_req != NULL)) { /* fused commands - get status for both operations */ - struct spdk_nvme_cpl *fused_response = &first_req->rsp->nvme_cpl; + struct spdk_nvme_cpl *first_response = &first_req->rsp->nvme_cpl; - spdk_bdev_io_get_nvme_fused_status(bdev_io, &cdw0, &second_sct, &second_sc, &first_sct, &first_sc); - fused_response->cdw0 = cdw0; - fused_response->status.sc = second_sc; - fused_response->status.sct = second_sct; + spdk_bdev_io_get_nvme_fused_status(bdev_io, &cdw0, &first_sct, &first_sc, &sct, &sc); + first_response->cdw0 = cdw0; + first_response->status.sc = first_sc; + first_response->status.sct = first_sct; /* first request should be completed */ spdk_nvmf_request_complete(first_req); req->first_fused_req = NULL; } else { - spdk_bdev_io_get_nvme_status(bdev_io, &cdw0, &first_sct, &first_sc); + spdk_bdev_io_get_nvme_status(bdev_io, &cdw0, &sct, &sc); } response->cdw0 = cdw0; - response->status.sc = first_sc; - response->status.sct = first_sct; + response->status.sc = sc; + response->status.sct = sct; spdk_nvmf_request_complete(req); spdk_bdev_free_io(bdev_io);