Commit 5b54916b authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476838


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1fea1fcc
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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;
	}