Commit 68bb3995 authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

nvmf: trivial optimization to make the code more consistent



Make the use of spdk_uuid_compare() to be consistent in the file,
also change the SPDK_INFOLOG to SPDK_DEBUGLOG to avoid the
repeated log messages for RESERVATION CONFLICT response.

Change-Id: I72fefbd520cefcaf25182c3ca3d21e3d87d17e94
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450884


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 3b214eb8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2383,7 +2383,8 @@ spdk_nvmf_ctrlr_process_io_cmd(struct spdk_nvmf_request *req)

	ns_info = &group->sgroups[ctrlr->subsys->id].ns_info[nsid - 1];
	if (nvmf_ns_reservation_request_check(ns_info, ctrlr, req)) {
		SPDK_NOTICELOG("Reservation Conflict for nsid %u, opcode %u\n", cmd->nsid, cmd->opc);
		SPDK_DEBUGLOG(SPDK_LOG_NVMF, "Reservation Conflict for nsid %u, opcode %u\n",
			      cmd->nsid, cmd->opc);
		return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
	}

+1 −1
Original line number Diff line number Diff line
@@ -1295,7 +1295,7 @@ nvmf_ns_reservation_get_registrant(struct spdk_nvmf_ns *ns,
	struct spdk_nvmf_registrant *reg, *tmp;

	TAILQ_FOREACH_SAFE(reg, &ns->registrants, link, tmp) {
		if (spdk_uuid_compare(&reg->hostid, uuid) == 0) {
		if (!spdk_uuid_compare(&reg->hostid, uuid)) {
			return reg;
		}
	}