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

nvmf: add reservation information to each subsystem's poll group



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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 2099401e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -947,6 +947,14 @@ poll_group_update_subsystem(struct spdk_nvmf_poll_group *group,
		} else {
			/* A namespace was present before and didn't change. */
		}

		if (ns == NULL) {
			memset(&sgroup->ns_info[i], 0, sizeof(struct spdk_nvmf_subsystem_pg_ns_info));
		} else if (ns->rtype && ns->holder) {
			sgroup->ns_info[i].crkey = ns->crkey;
			sgroup->ns_info[i].rtype = ns->rtype;
			sgroup->ns_info[i].hostid = ns->holder->hostid;
		}
	}

	return 0;
+7 −1
Original line number Diff line number Diff line
@@ -114,6 +114,12 @@ struct spdk_nvmf_transport_poll_group {

struct spdk_nvmf_subsystem_pg_ns_info {
	struct spdk_io_channel		*channel;
	/* current reservation key, no reservation if the value is 0 */
	uint64_t			crkey;
	/* reservation type */
	enum spdk_nvme_reservation_type	rtype;
	/* Host ID which holds the reservation */
	struct spdk_uuid		hostid;
};

struct spdk_nvmf_subsystem_poll_group {