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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450884
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Changpeng Liu 2019-04-10 22:09:28 -04:00 committed by Jim Harris
parent 3b214eb8f3
commit 68bb3995aa
2 changed files with 3 additions and 2 deletions

View File

@ -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]; ns_info = &group->sgroups[ctrlr->subsys->id].ns_info[nsid - 1];
if (nvmf_ns_reservation_request_check(ns_info, ctrlr, req)) { 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; return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
} }

View File

@ -1295,7 +1295,7 @@ nvmf_ns_reservation_get_registrant(struct spdk_nvmf_ns *ns,
struct spdk_nvmf_registrant *reg, *tmp; struct spdk_nvmf_registrant *reg, *tmp;
TAILQ_FOREACH_SAFE(reg, &ns->registrants, link, 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; return reg;
} }
} }