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 <james.r.harris@intel.com>
Change-Id: I833bf2a75cfec7b86da2d8a234f800de3510c2b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9867
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2021-05-13 20:39:14 +00:00 committed by Tomasz Zawadzki
parent d58d7e3c47
commit 67ac0638eb

View File

@ -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_nvmf_request *req = cb_arg;
struct spdk_nvme_cpl *response = &req->rsp->nvme_cpl; 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; uint32_t cdw0 = 0;
struct spdk_nvmf_request *first_req = req->first_fused_req; struct spdk_nvmf_request *first_req = req->first_fused_req;
if (spdk_unlikely(first_req != NULL)) { if (spdk_unlikely(first_req != NULL)) {
/* fused commands - get status for both operations */ /* 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); spdk_bdev_io_get_nvme_fused_status(bdev_io, &cdw0, &first_sct, &first_sc, &sct, &sc);
fused_response->cdw0 = cdw0; first_response->cdw0 = cdw0;
fused_response->status.sc = second_sc; first_response->status.sc = first_sc;
fused_response->status.sct = second_sct; first_response->status.sct = first_sct;
/* first request should be completed */ /* first request should be completed */
spdk_nvmf_request_complete(first_req); spdk_nvmf_request_complete(first_req);
req->first_fused_req = NULL; req->first_fused_req = NULL;
} else { } 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->cdw0 = cdw0;
response->status.sc = first_sc; response->status.sc = sc;
response->status.sct = first_sct; response->status.sct = sct;
spdk_nvmf_request_complete(req); spdk_nvmf_request_complete(req);
spdk_bdev_free_io(bdev_io); spdk_bdev_free_io(bdev_io);