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

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

target: make the tpg_get_default_depth method optional



All fabric drivers except for iSCSI always return 1, so implement
that as default behavior.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 55570113
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -377,7 +377,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	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_default_depth		= " + fabric_mod_name + "_get_default_depth,\n"
	buf += "	.tpg_get_pr_transport_id	= " + fabric_mod_name + "_get_pr_transport_id,\n"
	buf += "	.tpg_get_pr_transport_id_len	= " + fabric_mod_name + "_get_pr_transport_id_len,\n"
	buf += "	.tpg_parse_pr_out_transport_id	= " + fabric_mod_name + "_parse_pr_out_transport_id,\n"
@@ -590,13 +589,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
			buf += "}\n\n"
			bufi += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *);\n"

		if re.search('get_default_depth', fo):
			buf += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *se_tpg)\n"
			buf += "{\n"
			buf += "	return 1;\n"
			buf += "}\n\n"
			bufi += "u32 " + fabric_mod_name + "_get_default_depth(struct se_portal_group *);\n"

		if re.search('get_pr_transport_id\)\(', fo):
			buf += "u32 " + fabric_mod_name + "_get_pr_transport_id(\n"
			buf += "	struct se_portal_group *se_tpg,\n"
+0 −6
Original line number Diff line number Diff line
@@ -3411,11 +3411,6 @@ static u16 srpt_get_tag(struct se_portal_group *tpg)
	return 1;
}

static u32 srpt_get_default_depth(struct se_portal_group *se_tpg)
{
	return 1;
}

static u32 srpt_get_pr_transport_id(struct se_portal_group *se_tpg,
				    struct se_node_acl *se_nacl,
				    struct t10_pr_registration *pr_reg,
@@ -3920,7 +3915,6 @@ static const struct target_core_fabric_ops srpt_template = {
	.get_fabric_proto_ident		= srpt_get_fabric_proto_ident,
	.tpg_get_wwn			= srpt_get_fabric_wwn,
	.tpg_get_tag			= srpt_get_tag,
	.tpg_get_default_depth		= srpt_get_default_depth,
	.tpg_get_pr_transport_id	= srpt_get_pr_transport_id,
	.tpg_get_pr_transport_id_len	= srpt_get_pr_transport_id_len,
	.tpg_parse_pr_out_transport_id	= srpt_parse_pr_out_transport_id,
+0 −7
Original line number Diff line number Diff line
@@ -223,11 +223,6 @@ static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg)
	return tpg->lport_tpgt;
}

static u32 tcm_qla2xxx_get_default_depth(struct se_portal_group *se_tpg)
{
	return 1;
}

static u32 tcm_qla2xxx_get_pr_transport_id(
	struct se_portal_group *se_tpg,
	struct se_node_acl *se_nacl,
@@ -1991,7 +1986,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
	.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_default_depth		= tcm_qla2xxx_get_default_depth,
	.tpg_get_pr_transport_id	= tcm_qla2xxx_get_pr_transport_id,
	.tpg_get_pr_transport_id_len	= tcm_qla2xxx_get_pr_transport_id_len,
	.tpg_parse_pr_out_transport_id	= tcm_qla2xxx_parse_pr_out_transport_id,
@@ -2049,7 +2043,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
	.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_default_depth		= tcm_qla2xxx_get_default_depth,
	.tpg_get_pr_transport_id	= tcm_qla2xxx_get_pr_transport_id,
	.tpg_get_pr_transport_id_len	= tcm_qla2xxx_get_pr_transport_id_len,
	.tpg_parse_pr_out_transport_id	= tcm_qla2xxx_parse_pr_out_transport_id,
+0 −6
Original line number Diff line number Diff line
@@ -566,11 +566,6 @@ static u16 tcm_loop_get_tag(struct se_portal_group *se_tpg)
	return tl_tpg->tl_tpgt;
}

static u32 tcm_loop_get_default_depth(struct se_portal_group *se_tpg)
{
	return 1;
}

static u32 tcm_loop_get_pr_transport_id(
	struct se_portal_group *se_tpg,
	struct se_node_acl *se_nacl,
@@ -1378,7 +1373,6 @@ static const struct target_core_fabric_ops loop_ops = {
	.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_default_depth		= tcm_loop_get_default_depth,
	.tpg_get_pr_transport_id	= tcm_loop_get_pr_transport_id,
	.tpg_get_pr_transport_id_len	= tcm_loop_get_pr_transport_id_len,
	.tpg_parse_pr_out_transport_id	= tcm_loop_parse_pr_out_transport_id,
+0 −6
Original line number Diff line number Diff line
@@ -1707,11 +1707,6 @@ static u16 sbp_get_tag(struct se_portal_group *se_tpg)
	return tpg->tport_tpgt;
}

static u32 sbp_get_default_depth(struct se_portal_group *se_tpg)
{
	return 1;
}

static struct se_node_acl *sbp_alloc_fabric_acl(struct se_portal_group *se_tpg)
{
	return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
@@ -2490,7 +2485,6 @@ static const struct target_core_fabric_ops sbp_ops = {
	.get_fabric_proto_ident		= sbp_get_fabric_proto_ident,
	.tpg_get_wwn			= sbp_get_fabric_wwn,
	.tpg_get_tag			= sbp_get_tag,
	.tpg_get_default_depth		= sbp_get_default_depth,
	.tpg_get_pr_transport_id	= sbp_get_pr_transport_id,
	.tpg_get_pr_transport_id_len	= sbp_get_pr_transport_id_len,
	.tpg_parse_pr_out_transport_id	= sbp_parse_pr_out_transport_id,
Loading