nvmf: split reservation acquire/release as different cases

Reservation Acquire Action(rqcqa) is used for reservation acquire command, since
we have replaced cdw10 with specific commands fields, so split the two cases to
make the code looks more clear.

Change-Id: Ib2a2458dd0fe8345f1c33341dab1c4fe3b82829f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476838
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2019-12-04 20:49:24 -05:00 committed by Tomasz Zawadzki
parent 1fea1fccf5
commit 5b54916b83

View File

@ -2358,10 +2358,8 @@ nvmf_ns_reservation_request_check(struct spdk_nvmf_subsystem_pg_ns_info *ns_info
}
break;
case SPDK_NVME_OPC_RESERVATION_ACQUIRE:
case SPDK_NVME_OPC_RESERVATION_RELEASE:
racqa = cmd->cdw10_bits.resv_acquire.racqa;
if (cmd->opc == SPDK_NVME_OPC_RESERVATION_ACQUIRE &&
racqa == SPDK_NVME_RESERVE_ACQUIRE) {
if (racqa == SPDK_NVME_RESERVE_ACQUIRE) {
status = SPDK_NVME_SC_RESERVATION_CONFLICT;
goto exit;
}
@ -2370,6 +2368,12 @@ nvmf_ns_reservation_request_check(struct spdk_nvmf_subsystem_pg_ns_info *ns_info
goto exit;
}
break;
case SPDK_NVME_OPC_RESERVATION_RELEASE:
if (!is_registrant) {
status = SPDK_NVME_SC_RESERVATION_CONFLICT;
goto exit;
}
break;
default:
break;
}