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

Commit 30c7ca93 authored by David Disseldorp's avatar David Disseldorp Committed by Martin K. Petersen
Browse files

scsi: target: drop unnecessary get_fabric_name() accessor from fabric_ops



All fabrics return a const string. In all cases *except* iSCSI the
get_fabric_name() string matches fabric_ops.name.

Both fabric_ops.get_fabric_name() and fabric_ops.name are user-facing, with
the former being used for PR/ALUA state and the latter for ConfigFS
(config/target/$name), so we unfortunately need to keep both strings around
for now.  Replace the useless .get_fabric_name() accessor function with a
const string fabric_name member variable.

Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6baca760
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -3147,11 +3147,6 @@ static int srpt_check_false(struct se_portal_group *se_tpg)
	return 0;
}

static char *srpt_get_fabric_name(void)
{
	return "srpt";
}

static struct srpt_port *srpt_tpg_to_sport(struct se_portal_group *tpg)
{
	return tpg->se_tpg_wwn->priv;
@@ -3679,7 +3674,7 @@ static struct configfs_attribute *srpt_wwn_attrs[] = {
static const struct target_core_fabric_ops srpt_template = {
	.module				= THIS_MODULE,
	.name				= "srpt",
	.get_fabric_name		= srpt_get_fabric_name,
	.fabric_name			= "srpt",
	.tpg_get_wwn			= srpt_get_fabric_wwn,
	.tpg_get_tag			= srpt_get_tag,
	.tpg_check_demo_mode		= srpt_check_false,
+1 −6
Original line number Diff line number Diff line
@@ -3695,11 +3695,6 @@ static int ibmvscsis_get_system_info(void)
	return 0;
}

static char *ibmvscsis_get_fabric_name(void)
{
	return "ibmvscsis";
}

static char *ibmvscsis_get_fabric_wwn(struct se_portal_group *se_tpg)
{
	struct ibmvscsis_tport *tport =
@@ -4045,8 +4040,8 @@ static struct configfs_attribute *ibmvscsis_tpg_attrs[] = {
static const struct target_core_fabric_ops ibmvscsis_ops = {
	.module				= THIS_MODULE,
	.name				= "ibmvscsis",
	.fabric_name			= "ibmvscsis",
	.max_data_sg_nents		= MAX_TXU / PAGE_SIZE,
	.get_fabric_name		= ibmvscsis_get_fabric_name,
	.tpg_get_wwn			= ibmvscsis_get_fabric_wwn,
	.tpg_get_tag			= ibmvscsis_get_tag,
	.tpg_get_default_depth		= ibmvscsis_get_default_depth,
+2 −12
Original line number Diff line number Diff line
@@ -108,11 +108,6 @@ static ssize_t tcm_qla2xxx_format_wwn(char *buf, size_t len, u64 wwn)
		b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
}

static char *tcm_qla2xxx_get_fabric_name(void)
{
	return "qla2xxx";
}

/*
 * From drivers/scsi/scsi_transport_fc.c:fc_parse_wwn
 */
@@ -178,11 +173,6 @@ static int tcm_qla2xxx_npiv_parse_wwn(
	return 0;
}

static char *tcm_qla2xxx_npiv_get_fabric_name(void)
{
	return "qla2xxx_npiv";
}

static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg)
{
	struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
@@ -1921,13 +1911,13 @@ static struct configfs_attribute *tcm_qla2xxx_wwn_attrs[] = {
static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
	.module				= THIS_MODULE,
	.name				= "qla2xxx",
	.fabric_name			= "qla2xxx",
	.node_acl_size			= sizeof(struct tcm_qla2xxx_nacl),
	/*
	 * XXX: Limit assumes single page per scatter-gather-list entry.
	 * Current maximum is ~4.9 MB per se_cmd->t_data_sg with PAGE_SIZE=4096
	 */
	.max_data_sg_nents		= 1200,
	.get_fabric_name		= tcm_qla2xxx_get_fabric_name,
	.tpg_get_wwn			= tcm_qla2xxx_get_fabric_wwn,
	.tpg_get_tag			= tcm_qla2xxx_get_tag,
	.tpg_check_demo_mode		= tcm_qla2xxx_check_demo_mode,
@@ -1970,8 +1960,8 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
	.module				= THIS_MODULE,
	.name				= "qla2xxx_npiv",
	.fabric_name			= "qla2xxx_npiv",
	.node_acl_size			= sizeof(struct tcm_qla2xxx_nacl),
	.get_fabric_name		= tcm_qla2xxx_npiv_get_fabric_name,
	.tpg_get_wwn			= tcm_qla2xxx_get_fabric_wwn,
	.tpg_get_tag			= tcm_qla2xxx_get_tag,
	.tpg_check_demo_mode		= tcm_qla2xxx_check_demo_mode,
+1 −6
Original line number Diff line number Diff line
@@ -1343,11 +1343,6 @@ static struct configfs_attribute *lio_target_discovery_auth_attrs[] = {

/* Start functions for target_core_fabric_ops */

static char *iscsi_get_fabric_name(void)
{
	return "iSCSI";
}

static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
{
	struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
@@ -1550,8 +1545,8 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
const struct target_core_fabric_ops iscsi_ops = {
	.module				= THIS_MODULE,
	.name				= "iscsi",
	.fabric_name			= "iSCSI",
	.node_acl_size			= sizeof(struct iscsi_node_acl),
	.get_fabric_name		= iscsi_get_fabric_name,
	.tpg_get_wwn			= lio_tpg_get_endpoint_wwn,
	.tpg_get_tag			= lio_tpg_get_tag,
	.tpg_get_default_depth		= lio_tpg_get_default_depth,
+1 −6
Original line number Diff line number Diff line
@@ -460,11 +460,6 @@ static void tcm_loop_release_core_bus(void)
	pr_debug("Releasing TCM Loop Core BUS\n");
}

static char *tcm_loop_get_fabric_name(void)
{
	return "loopback";
}

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);
@@ -1150,7 +1145,7 @@ static struct configfs_attribute *tcm_loop_wwn_attrs[] = {
static const struct target_core_fabric_ops loop_ops = {
	.module				= THIS_MODULE,
	.name				= "loopback",
	.get_fabric_name		= tcm_loop_get_fabric_name,
	.fabric_name			= "loopback",
	.tpg_get_wwn			= tcm_loop_get_endpoint_wwn,
	.tpg_get_tag			= tcm_loop_get_tag,
	.tpg_check_demo_mode		= tcm_loop_check_demo_mode,
Loading