Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2aeeafae authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nicholas Bellinger
Browse files

target: remove the get_fabric_proto_ident method



Now that we store the protocol identifier in the tpg structure we don't
need this method.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent e4aae5af
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
@@ -300,9 +300,7 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	buf += "static const struct target_core_fabric_ops " + fabric_mod_name + "_ops = {\n"
	buf += "	.module				= THIS_MODULE,\n"
	buf += "	.name				= " + fabric_mod_name + ",\n"
	buf += "	.get_fabric_proto_ident		= " + fabric_mod_name + "_get_fabric_proto_ident,\n"
	buf += "	.get_fabric_name		= " + fabric_mod_name + "_get_fabric_name,\n"
	buf += "	.get_fabric_proto_ident		= " + fabric_mod_name + "_get_fabric_proto_ident,\n"
	buf += "	.tpg_get_wwn			= " + fabric_mod_name + "_get_fabric_wwn,\n"
	buf += "	.tpg_get_tag			= " + fabric_mod_name + "_get_tag,\n"
	buf += "	.tpg_get_pr_transport_id	= " + fabric_mod_name + "_get_pr_transport_id,\n"
@@ -461,35 +459,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
			bufi += "char *" + fabric_mod_name + "_get_fabric_name(void);\n"
			continue

		if re.search('get_fabric_proto_ident', fo):
			buf += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *se_tpg)\n"
			buf += "{\n"
			buf += "	struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n"
			buf += "				struct " + fabric_mod_name + "_tpg, se_tpg);\n"
			buf += "	struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n"
			buf += "	u8 proto_id;\n\n"
			buf += "	switch (" + fabric_mod_port + "->" + fabric_mod_port + "_proto_id) {\n"
			if proto_ident == "FC":
				buf += "	case SCSI_PROTOCOL_FCP:\n"
				buf += "	default:\n"
				buf += "		proto_id = fc_get_fabric_proto_ident(se_tpg);\n"
				buf += "		break;\n"
			elif proto_ident == "SAS":
				buf += "	case SCSI_PROTOCOL_SAS:\n"
				buf += "	default:\n"
				buf += "		proto_id = sas_get_fabric_proto_ident(se_tpg);\n"
				buf += "		break;\n"
			elif proto_ident == "iSCSI":
				buf += "	case SCSI_PROTOCOL_ISCSI:\n"
				buf += "	default:\n"
				buf += "		proto_id = iscsi_get_fabric_proto_ident(se_tpg);\n"
				buf += "		break;\n"

			buf += "	}\n\n"
			buf += "	return proto_id;\n"
			buf += "}\n\n"
			bufi += "u8 " + fabric_mod_name + "_get_fabric_proto_ident(struct se_portal_group *);\n"

		if re.search('get_wwn', fo):
			buf += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *se_tpg)\n"
			buf += "{\n"
+0 −6
Original line number Diff line number Diff line
@@ -3394,11 +3394,6 @@ static char *srpt_get_fabric_name(void)
	return "srpt";
}

static u8 srpt_get_fabric_proto_ident(struct se_portal_group *se_tpg)
{
	return SCSI_TRANSPORTID_PROTOCOLID_SRP;
}

static char *srpt_get_fabric_wwn(struct se_portal_group *tpg)
{
	struct srpt_port *sport = container_of(tpg, struct srpt_port, port_tpg_1);
@@ -3863,7 +3858,6 @@ static const struct target_core_fabric_ops srpt_template = {
	.name				= "srpt",
	.node_acl_size			= sizeof(struct srpt_node_acl),
	.get_fabric_name		= srpt_get_fabric_name,
	.get_fabric_proto_ident		= srpt_get_fabric_proto_ident,
	.tpg_get_wwn			= srpt_get_fabric_wwn,
	.tpg_get_tag			= srpt_get_tag,
	.tpg_get_pr_transport_id	= srpt_get_pr_transport_id,
+0 −19
Original line number Diff line number Diff line
@@ -190,23 +190,6 @@ static char *tcm_qla2xxx_npiv_get_fabric_name(void)
	return "qla2xxx_npiv";
}

static u8 tcm_qla2xxx_get_fabric_proto_ident(struct se_portal_group *se_tpg)
{
	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
				struct tcm_qla2xxx_tpg, se_tpg);
	struct tcm_qla2xxx_lport *lport = tpg->lport;
	u8 proto_id;

	switch (lport->lport_proto_id) {
	case SCSI_PROTOCOL_FCP:
	default:
		proto_id = fc_get_fabric_proto_ident(se_tpg);
		break;
	}

	return proto_id;
}

static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg)
{
	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
@@ -1928,7 +1911,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
	.name				= "qla2xxx",
	.node_acl_size			= sizeof(struct tcm_qla2xxx_nacl),
	.get_fabric_name		= tcm_qla2xxx_get_fabric_name,
	.get_fabric_proto_ident		= tcm_qla2xxx_get_fabric_proto_ident,
	.tpg_get_wwn			= tcm_qla2xxx_get_fabric_wwn,
	.tpg_get_tag			= tcm_qla2xxx_get_tag,
	.tpg_get_pr_transport_id	= tcm_qla2xxx_get_pr_transport_id,
@@ -1979,7 +1961,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
	.name				= "qla2xxx_npiv",
	.node_acl_size			= sizeof(struct tcm_qla2xxx_nacl),
	.get_fabric_name		= tcm_qla2xxx_npiv_get_fabric_name,
	.get_fabric_proto_ident		= tcm_qla2xxx_get_fabric_proto_ident,
	.tpg_get_wwn			= tcm_qla2xxx_get_fabric_wwn,
	.tpg_get_tag			= tcm_qla2xxx_get_tag,
	.tpg_get_pr_transport_id	= tcm_qla2xxx_get_pr_transport_id,
+0 −1
Original line number Diff line number Diff line
@@ -1918,7 +1918,6 @@ const struct target_core_fabric_ops iscsi_ops = {
	.name				= "iscsi",
	.node_acl_size			= sizeof(struct iscsi_node_acl),
	.get_fabric_name		= iscsi_get_fabric_name,
	.get_fabric_proto_ident		= iscsi_get_fabric_proto_ident,
	.tpg_get_wwn			= lio_tpg_get_endpoint_wwn,
	.tpg_get_tag			= lio_tpg_get_tag,
	.tpg_get_default_depth		= lio_tpg_get_default_depth,
+0 −27
Original line number Diff line number Diff line
@@ -525,32 +525,6 @@ static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg)
	return container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg);
}

static u8 tcm_loop_get_fabric_proto_ident(struct se_portal_group *se_tpg)
{
	struct tcm_loop_hba *tl_hba = tl_tpg(se_tpg)->tl_hba;
	/*
	 * tl_proto_id is set at tcm_loop_configfs.c:tcm_loop_make_scsi_hba()
	 * time based on the protocol dependent prefix of the passed configfs group.
	 *
	 * Based upon tl_proto_id, TCM_Loop emulates the requested fabric
	 * ProtocolID using target_core_fabric_lib.c symbols.
	 */
	switch (tl_hba->tl_proto_id) {
	case SCSI_PROTOCOL_SAS:
		return sas_get_fabric_proto_ident(se_tpg);
	case SCSI_PROTOCOL_FCP:
		return fc_get_fabric_proto_ident(se_tpg);
	case SCSI_PROTOCOL_ISCSI:
		return iscsi_get_fabric_proto_ident(se_tpg);
	default:
		pr_err("Unknown tl_proto_id: 0x%02x, using"
			" SAS emulation\n", tl_hba->tl_proto_id);
		break;
	}

	return sas_get_fabric_proto_ident(se_tpg);
}

static char *tcm_loop_get_endpoint_wwn(struct se_portal_group *se_tpg)
{
	/*
@@ -1356,7 +1330,6 @@ static const struct target_core_fabric_ops loop_ops = {
	.module				= THIS_MODULE,
	.name				= "loopback",
	.get_fabric_name		= tcm_loop_get_fabric_name,
	.get_fabric_proto_ident		= tcm_loop_get_fabric_proto_ident,
	.tpg_get_wwn			= tcm_loop_get_endpoint_wwn,
	.tpg_get_tag			= tcm_loop_get_tag,
	.tpg_get_pr_transport_id	= tcm_loop_get_pr_transport_id,
Loading