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

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
...@@ -3147,11 +3147,6 @@ static int srpt_check_false(struct se_portal_group *se_tpg) ...@@ -3147,11 +3147,6 @@ static int srpt_check_false(struct se_portal_group *se_tpg)
return 0; return 0;
} }
static char *srpt_get_fabric_name(void)
{
return "srpt";
}
static struct srpt_port *srpt_tpg_to_sport(struct se_portal_group *tpg) static struct srpt_port *srpt_tpg_to_sport(struct se_portal_group *tpg)
{ {
return tpg->se_tpg_wwn->priv; return tpg->se_tpg_wwn->priv;
...@@ -3679,7 +3674,7 @@ static struct configfs_attribute *srpt_wwn_attrs[] = { ...@@ -3679,7 +3674,7 @@ static struct configfs_attribute *srpt_wwn_attrs[] = {
static const struct target_core_fabric_ops srpt_template = { static const struct target_core_fabric_ops srpt_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "srpt", .name = "srpt",
.get_fabric_name = srpt_get_fabric_name, .fabric_name = "srpt",
.tpg_get_wwn = srpt_get_fabric_wwn, .tpg_get_wwn = srpt_get_fabric_wwn,
.tpg_get_tag = srpt_get_tag, .tpg_get_tag = srpt_get_tag,
.tpg_check_demo_mode = srpt_check_false, .tpg_check_demo_mode = srpt_check_false,
......
...@@ -3695,11 +3695,6 @@ static int ibmvscsis_get_system_info(void) ...@@ -3695,11 +3695,6 @@ static int ibmvscsis_get_system_info(void)
return 0; return 0;
} }
static char *ibmvscsis_get_fabric_name(void)
{
return "ibmvscsis";
}
static char *ibmvscsis_get_fabric_wwn(struct se_portal_group *se_tpg) static char *ibmvscsis_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
struct ibmvscsis_tport *tport = struct ibmvscsis_tport *tport =
...@@ -4045,8 +4040,8 @@ static struct configfs_attribute *ibmvscsis_tpg_attrs[] = { ...@@ -4045,8 +4040,8 @@ static struct configfs_attribute *ibmvscsis_tpg_attrs[] = {
static const struct target_core_fabric_ops ibmvscsis_ops = { static const struct target_core_fabric_ops ibmvscsis_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "ibmvscsis", .name = "ibmvscsis",
.fabric_name = "ibmvscsis",
.max_data_sg_nents = MAX_TXU / PAGE_SIZE, .max_data_sg_nents = MAX_TXU / PAGE_SIZE,
.get_fabric_name = ibmvscsis_get_fabric_name,
.tpg_get_wwn = ibmvscsis_get_fabric_wwn, .tpg_get_wwn = ibmvscsis_get_fabric_wwn,
.tpg_get_tag = ibmvscsis_get_tag, .tpg_get_tag = ibmvscsis_get_tag,
.tpg_get_default_depth = ibmvscsis_get_default_depth, .tpg_get_default_depth = ibmvscsis_get_default_depth,
......
...@@ -108,11 +108,6 @@ static ssize_t tcm_qla2xxx_format_wwn(char *buf, size_t len, u64 wwn) ...@@ -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]); 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 * From drivers/scsi/scsi_transport_fc.c:fc_parse_wwn
*/ */
...@@ -178,11 +173,6 @@ static int tcm_qla2xxx_npiv_parse_wwn( ...@@ -178,11 +173,6 @@ static int tcm_qla2xxx_npiv_parse_wwn(
return 0; 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) static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg,
...@@ -1921,13 +1911,13 @@ static struct configfs_attribute *tcm_qla2xxx_wwn_attrs[] = { ...@@ -1921,13 +1911,13 @@ static struct configfs_attribute *tcm_qla2xxx_wwn_attrs[] = {
static const struct target_core_fabric_ops tcm_qla2xxx_ops = { static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "qla2xxx", .name = "qla2xxx",
.fabric_name = "qla2xxx",
.node_acl_size = sizeof(struct tcm_qla2xxx_nacl), .node_acl_size = sizeof(struct tcm_qla2xxx_nacl),
/* /*
* XXX: Limit assumes single page per scatter-gather-list entry. * 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 * Current maximum is ~4.9 MB per se_cmd->t_data_sg with PAGE_SIZE=4096
*/ */
.max_data_sg_nents = 1200, .max_data_sg_nents = 1200,
.get_fabric_name = tcm_qla2xxx_get_fabric_name,
.tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn, .tpg_get_wwn = tcm_qla2xxx_get_fabric_wwn,
.tpg_get_tag = tcm_qla2xxx_get_tag, .tpg_get_tag = tcm_qla2xxx_get_tag,
.tpg_check_demo_mode = tcm_qla2xxx_check_demo_mode, .tpg_check_demo_mode = tcm_qla2xxx_check_demo_mode,
...@@ -1970,8 +1960,8 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { ...@@ -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 = { static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "qla2xxx_npiv", .name = "qla2xxx_npiv",
.fabric_name = "qla2xxx_npiv",
.node_acl_size = sizeof(struct tcm_qla2xxx_nacl), .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_wwn = tcm_qla2xxx_get_fabric_wwn,
.tpg_get_tag = tcm_qla2xxx_get_tag, .tpg_get_tag = tcm_qla2xxx_get_tag,
.tpg_check_demo_mode = tcm_qla2xxx_check_demo_mode, .tpg_check_demo_mode = tcm_qla2xxx_check_demo_mode,
......
...@@ -1343,11 +1343,6 @@ static struct configfs_attribute *lio_target_discovery_auth_attrs[] = { ...@@ -1343,11 +1343,6 @@ static struct configfs_attribute *lio_target_discovery_auth_attrs[] = {
/* Start functions for target_core_fabric_ops */ /* 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) static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
{ {
struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_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) ...@@ -1550,8 +1545,8 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
const struct target_core_fabric_ops iscsi_ops = { const struct target_core_fabric_ops iscsi_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "iscsi", .name = "iscsi",
.fabric_name = "iSCSI",
.node_acl_size = sizeof(struct iscsi_node_acl), .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_wwn = lio_tpg_get_endpoint_wwn,
.tpg_get_tag = lio_tpg_get_tag, .tpg_get_tag = lio_tpg_get_tag,
.tpg_get_default_depth = lio_tpg_get_default_depth, .tpg_get_default_depth = lio_tpg_get_default_depth,
......
...@@ -460,11 +460,6 @@ static void tcm_loop_release_core_bus(void) ...@@ -460,11 +460,6 @@ static void tcm_loop_release_core_bus(void)
pr_debug("Releasing TCM Loop Core BUS\n"); 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) 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); return container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg);
...@@ -1150,7 +1145,7 @@ static struct configfs_attribute *tcm_loop_wwn_attrs[] = { ...@@ -1150,7 +1145,7 @@ static struct configfs_attribute *tcm_loop_wwn_attrs[] = {
static const struct target_core_fabric_ops loop_ops = { static const struct target_core_fabric_ops loop_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "loopback", .name = "loopback",
.get_fabric_name = tcm_loop_get_fabric_name, .fabric_name = "loopback",
.tpg_get_wwn = tcm_loop_get_endpoint_wwn, .tpg_get_wwn = tcm_loop_get_endpoint_wwn,
.tpg_get_tag = tcm_loop_get_tag, .tpg_get_tag = tcm_loop_get_tag,
.tpg_check_demo_mode = tcm_loop_check_demo_mode, .tpg_check_demo_mode = tcm_loop_check_demo_mode,
......
...@@ -1694,11 +1694,6 @@ static int sbp_check_false(struct se_portal_group *se_tpg) ...@@ -1694,11 +1694,6 @@ static int sbp_check_false(struct se_portal_group *se_tpg)
return 0; return 0;
} }
static char *sbp_get_fabric_name(void)
{
return "sbp";
}
static char *sbp_get_fabric_wwn(struct se_portal_group *se_tpg) static char *sbp_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg); struct sbp_tpg *tpg = container_of(se_tpg, struct sbp_tpg, se_tpg);
...@@ -2324,7 +2319,7 @@ static struct configfs_attribute *sbp_tpg_attrib_attrs[] = { ...@@ -2324,7 +2319,7 @@ static struct configfs_attribute *sbp_tpg_attrib_attrs[] = {
static const struct target_core_fabric_ops sbp_ops = { static const struct target_core_fabric_ops sbp_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "sbp", .name = "sbp",
.get_fabric_name = sbp_get_fabric_name, .fabric_name = "sbp",
.tpg_get_wwn = sbp_get_fabric_wwn, .tpg_get_wwn = sbp_get_fabric_wwn,
.tpg_get_tag = sbp_get_tag, .tpg_get_tag = sbp_get_tag,
.tpg_check_demo_mode = sbp_check_true, .tpg_check_demo_mode = sbp_check_true,
......
...@@ -451,7 +451,7 @@ static inline void set_ascq(struct se_cmd *cmd, u8 alua_ascq) ...@@ -451,7 +451,7 @@ static inline void set_ascq(struct se_cmd *cmd, u8 alua_ascq)
pr_debug("[%s]: ALUA TG Port not available, " pr_debug("[%s]: ALUA TG Port not available, "
"SenseKey: NOT_READY, ASC/ASCQ: " "SenseKey: NOT_READY, ASC/ASCQ: "
"0x04/0x%02x\n", "0x04/0x%02x\n",
cmd->se_tfo->get_fabric_name(), alua_ascq); cmd->se_tfo->fabric_name, alua_ascq);
cmd->scsi_asc = 0x04; cmd->scsi_asc = 0x04;
cmd->scsi_ascq = alua_ascq; cmd->scsi_ascq = alua_ascq;
...@@ -1229,13 +1229,13 @@ static int core_alua_update_tpg_secondary_metadata(struct se_lun *lun) ...@@ -1229,13 +1229,13 @@ static int core_alua_update_tpg_secondary_metadata(struct se_lun *lun)
if (se_tpg->se_tpg_tfo->tpg_get_tag != NULL) { if (se_tpg->se_tpg_tfo->tpg_get_tag != NULL) {
path = kasprintf(GFP_KERNEL, "%s/alua/%s/%s+%hu/lun_%llu", path = kasprintf(GFP_KERNEL, "%s/alua/%s/%s+%hu/lun_%llu",
db_root, se_tpg->se_tpg_tfo->get_fabric_name(), db_root, se_tpg->se_tpg_tfo->fabric_name,
se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg), se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg),
se_tpg->se_tpg_tfo->tpg_get_tag(se_tpg), se_tpg->se_tpg_tfo->tpg_get_tag(se_tpg),
lun->unpacked_lun); lun->unpacked_lun);
} else { } else {
path = kasprintf(GFP_KERNEL, "%s/alua/%s/%s/lun_%llu", path = kasprintf(GFP_KERNEL, "%s/alua/%s/%s/lun_%llu",
db_root, se_tpg->se_tpg_tfo->get_fabric_name(), db_root, se_tpg->se_tpg_tfo->fabric_name,
se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg), se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg),
lun->unpacked_lun); lun->unpacked_lun);
} }
......
...@@ -351,8 +351,8 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo) ...@@ -351,8 +351,8 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
"_NAME_SIZE\n", tfo->name); "_NAME_SIZE\n", tfo->name);
return -EINVAL; return -EINVAL;
} }
if (!tfo->get_fabric_name) { if (!tfo->fabric_name) {
pr_err("Missing tfo->get_fabric_name()\n"); pr_err("Missing tfo->fabric_name\n");
return -EINVAL; return -EINVAL;
} }
if (!tfo->tpg_get_wwn) { if (!tfo->tpg_get_wwn) {
...@@ -1403,7 +1403,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(struct se_device *dev, ...@@ -1403,7 +1403,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(struct se_device *dev,
core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN);
return sprintf(page, "SPC-3 Reservation: %s Initiator: %s%s\n", return sprintf(page, "SPC-3 Reservation: %s Initiator: %s%s\n",
se_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), se_nacl->se_tpg->se_tpg_tfo->fabric_name,
se_nacl->initiatorname, i_buf); se_nacl->initiatorname, i_buf);
} }
...@@ -1417,7 +1417,7 @@ static ssize_t target_core_dev_pr_show_spc2_res(struct se_device *dev, ...@@ -1417,7 +1417,7 @@ static ssize_t target_core_dev_pr_show_spc2_res(struct se_device *dev,
if (se_nacl) { if (se_nacl) {
len = sprintf(page, len = sprintf(page,
"SPC-2 Reservation: %s Initiator: %s\n", "SPC-2 Reservation: %s Initiator: %s\n",
se_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), se_nacl->se_tpg->se_tpg_tfo->fabric_name,
se_nacl->initiatorname); se_nacl->initiatorname);
} else { } else {
len = sprintf(page, "No SPC-2 Reservation holder\n"); len = sprintf(page, "No SPC-2 Reservation holder\n");
...@@ -1495,13 +1495,13 @@ static ssize_t target_pr_res_pr_holder_tg_port_show(struct config_item *item, ...@@ -1495,13 +1495,13 @@ static ssize_t target_pr_res_pr_holder_tg_port_show(struct config_item *item,
tfo = se_tpg->se_tpg_tfo; tfo = se_tpg->se_tpg_tfo;
len += sprintf(page+len, "SPC-3 Reservation: %s" len += sprintf(page+len, "SPC-3 Reservation: %s"
" Target Node Endpoint: %s\n", tfo->get_fabric_name(), " Target Node Endpoint: %s\n", tfo->fabric_name,
tfo->tpg_get_wwn(se_tpg)); tfo->tpg_get_wwn(se_tpg));
len += sprintf(page+len, "SPC-3 Reservation: Relative Port" len += sprintf(page+len, "SPC-3 Reservation: Relative Port"
" Identifier Tag: %hu %s Portal Group Tag: %hu" " Identifier Tag: %hu %s Portal Group Tag: %hu"
" %s Logical Unit: %llu\n", pr_reg->tg_pt_sep_rtpi, " %s Logical Unit: %llu\n", pr_reg->tg_pt_sep_rtpi,
tfo->get_fabric_name(), tfo->tpg_get_tag(se_tpg), tfo->fabric_name, tfo->tpg_get_tag(se_tpg),
tfo->get_fabric_name(), pr_reg->pr_aptpl_target_lun); tfo->fabric_name, pr_reg->pr_aptpl_target_lun);
out_unlock: out_unlock:
spin_unlock(&dev->dev_reservation_lock); spin_unlock(&dev->dev_reservation_lock);
...@@ -1532,7 +1532,7 @@ static ssize_t target_pr_res_pr_registered_i_pts_show(struct config_item *item, ...@@ -1532,7 +1532,7 @@ static ssize_t target_pr_res_pr_registered_i_pts_show(struct config_item *item,
core_pr_dump_initiator_port(pr_reg, i_buf, core_pr_dump_initiator_port(pr_reg, i_buf,
PR_REG_ISID_ID_LEN); PR_REG_ISID_ID_LEN);
sprintf(buf, "%s Node: %s%s Key: 0x%016Lx PRgen: 0x%08x\n", sprintf(buf, "%s Node: %s%s Key: 0x%016Lx PRgen: 0x%08x\n",
tfo->get_fabric_name(), tfo->fabric_name,
pr_reg->pr_reg_nacl->initiatorname, i_buf, pr_reg->pr_res_key, pr_reg->pr_reg_nacl->initiatorname, i_buf, pr_reg->pr_res_key,
pr_reg->pr_res_generation); pr_reg->pr_res_generation);
...@@ -2757,7 +2757,7 @@ static ssize_t target_tg_pt_gp_members_show(struct config_item *item, ...@@ -2757,7 +2757,7 @@ static ssize_t target_tg_pt_gp_members_show(struct config_item *item,
struct se_portal_group *tpg = lun->lun_tpg; struct se_portal_group *tpg = lun->lun_tpg;
cur_len = snprintf(buf, TG_PT_GROUP_NAME_BUF, "%s/%s/tpgt_%hu" cur_len = snprintf(buf, TG_PT_GROUP_NAME_BUF, "%s/%s/tpgt_%hu"
"/%s\n", tpg->se_tpg_tfo->get_fabric_name(), "/%s\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_wwn(tpg), tpg->se_tpg_tfo->tpg_get_wwn(tpg),
tpg->se_tpg_tfo->tpg_get_tag(tpg), tpg->se_tpg_tfo->tpg_get_tag(tpg),
config_item_name(&lun->lun_group.cg_item)); config_item_name(&lun->lun_group.cg_item));
......
...@@ -95,7 +95,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) ...@@ -95,7 +95,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
deve->lun_access_ro) { deve->lun_access_ro) {
pr_err("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN" pr_err("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN"
" Access for 0x%08llx\n", " Access for 0x%08llx\n",
se_cmd->se_tfo->get_fabric_name(), se_cmd->se_tfo->fabric_name,
unpacked_lun); unpacked_lun);
rcu_read_unlock(); rcu_read_unlock();
ret = TCM_WRITE_PROTECTED; ret = TCM_WRITE_PROTECTED;
...@@ -114,7 +114,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) ...@@ -114,7 +114,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
if (unpacked_lun != 0) { if (unpacked_lun != 0) {
pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN" pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
" Access for 0x%08llx\n", " Access for 0x%08llx\n",
se_cmd->se_tfo->get_fabric_name(), se_cmd->se_tfo->fabric_name,
unpacked_lun); unpacked_lun);
return TCM_NON_EXISTENT_LUN; return TCM_NON_EXISTENT_LUN;
} }
...@@ -188,7 +188,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u64 unpacked_lun) ...@@ -188,7 +188,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
if (!se_lun) { if (!se_lun) {
pr_debug("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN" pr_debug("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
" Access for 0x%08llx\n", " Access for 0x%08llx\n",
se_cmd->se_tfo->get_fabric_name(), se_cmd->se_tfo->fabric_name,
unpacked_lun); unpacked_lun);
return -ENODEV; return -ENODEV;
} }
...@@ -237,7 +237,7 @@ struct se_dev_entry *core_get_se_deve_from_rtpi( ...@@ -237,7 +237,7 @@ struct se_dev_entry *core_get_se_deve_from_rtpi(
if (!lun) { if (!lun) {
pr_err("%s device entries device pointer is" pr_err("%s device entries device pointer is"
" NULL, but Initiator has access.\n", " NULL, but Initiator has access.\n",
tpg->se_tpg_tfo->get_fabric_name()); tpg->se_tpg_tfo->fabric_name);
continue; continue;
} }
if (lun->lun_rtpi != rtpi) if (lun->lun_rtpi != rtpi)
...@@ -571,9 +571,9 @@ int core_dev_add_lun( ...@@ -571,9 +571,9 @@ int core_dev_add_lun(
return rc; return rc;
pr_debug("%s_TPG[%u]_LUN[%llu] - Activated %s Logical Unit from" pr_debug("%s_TPG[%u]_LUN[%llu] - Activated %s Logical Unit from"
" CORE HBA: %u\n", tpg->se_tpg_tfo->get_fabric_name(), " CORE HBA: %u\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
tpg->se_tpg_tfo->get_fabric_name(), dev->se_hba->hba_id); tpg->se_tpg_tfo->fabric_name, dev->se_hba->hba_id);
/* /*
* Update LUN maps for dynamically added initiators when * Update LUN maps for dynamically added initiators when
* generate_node_acl is enabled. * generate_node_acl is enabled.
...@@ -604,9 +604,9 @@ void core_dev_del_lun( ...@@ -604,9 +604,9 @@ void core_dev_del_lun(
struct se_lun *lun) struct se_lun *lun)
{ {
pr_debug("%s_TPG[%u]_LUN[%llu] - Deactivating %s Logical Unit from" pr_debug("%s_TPG[%u]_LUN[%llu] - Deactivating %s Logical Unit from"
" device object\n", tpg->se_tpg_tfo->get_fabric_name(), " device object\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
tpg->se_tpg_tfo->get_fabric_name()); tpg->se_tpg_tfo->fabric_name);
core_tpg_remove_lun(tpg, lun); core_tpg_remove_lun(tpg, lun);
} }
...@@ -621,7 +621,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl( ...@@ -621,7 +621,7 @@ struct se_lun_acl *core_dev_init_initiator_node_lun_acl(
if (strlen(nacl->initiatorname) >= TRANSPORT_IQN_LEN) { if (strlen(nacl->initiatorname) >= TRANSPORT_IQN_LEN) {
pr_err("%s InitiatorName exceeds maximum size.\n", pr_err("%s InitiatorName exceeds maximum size.\n",
tpg->se_tpg_tfo->get_fabric_name()); tpg->se_tpg_tfo->fabric_name);
*ret = -EOVERFLOW; *ret = -EOVERFLOW;
return NULL; return NULL;
} }
...@@ -664,7 +664,7 @@ int core_dev_add_initiator_node_lun_acl( ...@@ -664,7 +664,7 @@ int core_dev_add_initiator_node_lun_acl(
return -EINVAL; return -EINVAL;
pr_debug("%s_TPG[%hu]_LUN[%llu->%llu] - Added %s ACL for " pr_debug("%s_TPG[%hu]_LUN[%llu->%llu] - Added %s ACL for "
" InitiatorNode: %s\n", tpg->se_tpg_tfo->get_fabric_name(), " InitiatorNode: %s\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, lacl->mapped_lun, tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, lacl->mapped_lun,
lun_access_ro ? "RO" : "RW", lun_access_ro ? "RO" : "RW",
nacl->initiatorname); nacl->initiatorname);
...@@ -697,7 +697,7 @@ int core_dev_del_initiator_node_lun_acl( ...@@ -697,7 +697,7 @@ int core_dev_del_initiator_node_lun_acl(
pr_debug("%s_TPG[%hu]_LUN[%llu] - Removed ACL for" pr_debug("%s_TPG[%hu]_LUN[%llu] - Removed ACL for"
" InitiatorNode: %s Mapped LUN: %llu\n", " InitiatorNode: %s Mapped LUN: %llu\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
nacl->initiatorname, lacl->mapped_lun); nacl->initiatorname, lacl->mapped_lun);
...@@ -709,9 +709,9 @@ void core_dev_free_initiator_node_lun_acl( ...@@ -709,9 +709,9 @@ void core_dev_free_initiator_node_lun_acl(
struct se_lun_acl *lacl) struct se_lun_acl *lacl)
{ {
pr_debug("%s_TPG[%hu] - Freeing ACL for %s InitiatorNode: %s" pr_debug("%s_TPG[%hu] - Freeing ACL for %s InitiatorNode: %s"
" Mapped LUN: %llu\n", tpg->se_tpg_tfo->get_fabric_name(), " Mapped LUN: %llu\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), tpg->se_tpg_tfo->tpg_get_tag(tpg),
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
lacl->se_lun_nacl->initiatorname, lacl->mapped_lun); lacl->se_lun_nacl->initiatorname, lacl->mapped_lun);
kfree(lacl); kfree(lacl);
......
...@@ -203,7 +203,7 @@ static ssize_t target_fabric_mappedlun_write_protect_store( ...@@ -203,7 +203,7 @@ static ssize_t target_fabric_mappedlun_write_protect_store(
pr_debug("%s_ConfigFS: Changed Initiator ACL: %s" pr_debug("%s_ConfigFS: Changed Initiator ACL: %s"
" Mapped LUN: %llu Write Protect bit to %s\n", " Mapped LUN: %llu Write Protect bit to %s\n",
se_tpg->se_tpg_tfo->get_fabric_name(), se_tpg->se_tpg_tfo->fabric_name,
se_nacl->initiatorname, lacl->mapped_lun, (wp) ? "ON" : "OFF"); se_nacl->initiatorname, lacl->mapped_lun, (wp) ? "ON" : "OFF");
return count; return count;
......
This diff is collapsed.
...@@ -612,7 +612,7 @@ static ssize_t target_stat_tgt_port_name_show(struct config_item *item, ...@@ -612,7 +612,7 @@ static ssize_t target_stat_tgt_port_name_show(struct config_item *item,
dev = rcu_dereference(lun->lun_se_dev); dev = rcu_dereference(lun->lun_se_dev);
if (dev) if (dev)
ret = snprintf(page, PAGE_SIZE, "%sPort#%u\n", ret = snprintf(page, PAGE_SIZE, "%sPort#%u\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
lun->lun_rtpi); lun->lun_rtpi);
rcu_read_unlock(); rcu_read_unlock();
return ret; return ret;
...@@ -767,7 +767,7 @@ static ssize_t target_stat_transport_device_show(struct config_item *item, ...@@ -767,7 +767,7 @@ static ssize_t target_stat_transport_device_show(struct config_item *item,
if (dev) { if (dev) {
/* scsiTransportType */ /* scsiTransportType */
ret = snprintf(page, PAGE_SIZE, "scsiTransport%s\n", ret = snprintf(page, PAGE_SIZE, "scsiTransport%s\n",
tpg->se_tpg_tfo->get_fabric_name()); tpg->se_tpg_tfo->fabric_name);
} }
rcu_read_unlock(); rcu_read_unlock();
return ret; return ret;
......
...@@ -163,7 +163,7 @@ void core_tmr_abort_task( ...@@ -163,7 +163,7 @@ void core_tmr_abort_task(
continue; continue;
printk("ABORT_TASK: Found referenced %s task_tag: %llu\n", printk("ABORT_TASK: Found referenced %s task_tag: %llu\n",
se_cmd->se_tfo->get_fabric_name(), ref_tag); se_cmd->se_tfo->fabric_name, ref_tag);
if (!__target_check_io_state(se_cmd, se_sess, 0)) if (!__target_check_io_state(se_cmd, se_sess, 0))
continue; continue;
...@@ -398,7 +398,7 @@ int core_tmr_lun_reset( ...@@ -398,7 +398,7 @@ int core_tmr_lun_reset(
if (tmr_nacl && tmr_tpg) { if (tmr_nacl && tmr_tpg) {
pr_debug("LUN_RESET: TMR caller fabric: %s" pr_debug("LUN_RESET: TMR caller fabric: %s"
" initiator port %s\n", " initiator port %s\n",
tmr_tpg->se_tpg_tfo->get_fabric_name(), tmr_tpg->se_tpg_tfo->fabric_name,
tmr_nacl->initiatorname); tmr_nacl->initiatorname);
} }
} }
......
...@@ -151,7 +151,7 @@ void core_tpg_add_node_to_devs( ...@@ -151,7 +151,7 @@ void core_tpg_add_node_to_devs(
pr_debug("TARGET_CORE[%s]->TPG[%u]_LUN[%llu] - Adding %s" pr_debug("TARGET_CORE[%s]->TPG[%u]_LUN[%llu] - Adding %s"
" access for LUN in Demo Mode\n", " access for LUN in Demo Mode\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun, tpg->se_tpg_tfo->tpg_get_tag(tpg), lun->unpacked_lun,
lun_access_ro ? "READ-ONLY" : "READ-WRITE"); lun_access_ro ? "READ-ONLY" : "READ-WRITE");
...@@ -176,7 +176,7 @@ target_set_nacl_queue_depth(struct se_portal_group *tpg, ...@@ -176,7 +176,7 @@ target_set_nacl_queue_depth(struct se_portal_group *tpg,
if (!acl->queue_depth) { if (!acl->queue_depth) {
pr_warn("Queue depth for %s Initiator Node: %s is 0," pr_warn("Queue depth for %s Initiator Node: %s is 0,"
"defaulting to 1.\n", tpg->se_tpg_tfo->get_fabric_name(), "defaulting to 1.\n", tpg->se_tpg_tfo->fabric_name,
acl->initiatorname); acl->initiatorname);
acl->queue_depth = 1; acl->queue_depth = 1;
} }
...@@ -227,11 +227,11 @@ static void target_add_node_acl(struct se_node_acl *acl) ...@@ -227,11 +227,11 @@ static void target_add_node_acl(struct se_node_acl *acl)
pr_debug("%s_TPG[%hu] - Added %s ACL with TCQ Depth: %d for %s" pr_debug("%s_TPG[%hu] - Added %s ACL with TCQ Depth: %d for %s"
" Initiator Node: %s\n", " Initiator Node: %s\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), tpg->se_tpg_tfo->tpg_get_tag(tpg),
acl->dynamic_node_acl ? "DYNAMIC" : "", acl->dynamic_node_acl ? "DYNAMIC" : "",
acl->queue_depth, acl->queue_depth,
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
acl->initiatorname); acl->initiatorname);
} }
...@@ -313,7 +313,7 @@ struct se_node_acl *core_tpg_add_initiator_node_acl( ...@@ -313,7 +313,7 @@ struct se_node_acl *core_tpg_add_initiator_node_acl(
if (acl->dynamic_node_acl) { if (acl->dynamic_node_acl) {
acl->dynamic_node_acl = 0; acl->dynamic_node_acl = 0;
pr_debug("%s_TPG[%u] - Replacing dynamic ACL" pr_debug("%s_TPG[%u] - Replacing dynamic ACL"
" for %s\n", tpg->se_tpg_tfo->get_fabric_name(), " for %s\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), initiatorname); tpg->se_tpg_tfo->tpg_get_tag(tpg), initiatorname);
mutex_unlock(&tpg->acl_node_mutex); mutex_unlock(&tpg->acl_node_mutex);
return acl; return acl;
...@@ -321,7 +321,7 @@ struct se_node_acl *core_tpg_add_initiator_node_acl( ...@@ -321,7 +321,7 @@ struct se_node_acl *core_tpg_add_initiator_node_acl(
pr_err("ACL entry for %s Initiator" pr_err("ACL entry for %s Initiator"
" Node %s already exists for TPG %u, ignoring" " Node %s already exists for TPG %u, ignoring"
" request.\n", tpg->se_tpg_tfo->get_fabric_name(), " request.\n", tpg->se_tpg_tfo->fabric_name,
initiatorname, tpg->se_tpg_tfo->tpg_get_tag(tpg)); initiatorname, tpg->se_tpg_tfo->tpg_get_tag(tpg));
mutex_unlock(&tpg->acl_node_mutex); mutex_unlock(&tpg->acl_node_mutex);
return ERR_PTR(-EEXIST); return ERR_PTR(-EEXIST);
...@@ -380,9 +380,9 @@ void core_tpg_del_initiator_node_acl(struct se_node_acl *acl) ...@@ -380,9 +380,9 @@ void core_tpg_del_initiator_node_acl(struct se_node_acl *acl)
core_free_device_list_for_node(acl, tpg); core_free_device_list_for_node(acl, tpg);
pr_debug("%s_TPG[%hu] - Deleted ACL with TCQ Depth: %d for %s" pr_debug("%s_TPG[%hu] - Deleted ACL with TCQ Depth: %d for %s"
" Initiator Node: %s\n", tpg->se_tpg_tfo->get_fabric_name(), " Initiator Node: %s\n", tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth, tpg->se_tpg_tfo->tpg_get_tag(tpg), acl->queue_depth,
tpg->se_tpg_tfo->get_fabric_name(), acl->initiatorname); tpg->se_tpg_tfo->fabric_name, acl->initiatorname);
kfree(acl); kfree(acl);
} }
...@@ -418,7 +418,7 @@ int core_tpg_set_initiator_node_queue_depth( ...@@ -418,7 +418,7 @@ int core_tpg_set_initiator_node_queue_depth(
pr_debug("Successfully changed queue depth to: %d for Initiator" pr_debug("Successfully changed queue depth to: %d for Initiator"
" Node: %s on %s Target Portal Group: %u\n", acl->queue_depth, " Node: %s on %s Target Portal Group: %u\n", acl->queue_depth,
acl->initiatorname, tpg->se_tpg_tfo->get_fabric_name(), acl->initiatorname, tpg->se_tpg_tfo->fabric_name,
tpg->se_tpg_tfo->tpg_get_tag(tpg)); tpg->se_tpg_tfo->tpg_get_tag(tpg));
return 0; return 0;
...@@ -512,7 +512,7 @@ int core_tpg_register( ...@@ -512,7 +512,7 @@ int core_tpg_register(
spin_unlock_bh(&tpg_lock); spin_unlock_bh(&tpg_lock);
pr_debug("TARGET_CORE[%s]: Allocated portal_group for endpoint: %s, " pr_debug("TARGET_CORE[%s]: Allocated portal_group for endpoint: %s, "
"Proto: %d, Portal Tag: %u\n", se_tpg->se_tpg_tfo->get_fabric_name(), "Proto: %d, Portal Tag: %u\n", se_tpg->se_tpg_tfo->fabric_name,
se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg) ? se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg) ?
se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg) : NULL, se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg) : NULL,
se_tpg->proto_id, se_tpg->se_tpg_tfo->tpg_get_tag(se_tpg)); se_tpg->proto_id, se_tpg->se_tpg_tfo->tpg_get_tag(se_tpg));
...@@ -528,7 +528,7 @@ int core_tpg_deregister(struct se_portal_group *se_tpg) ...@@ -528,7 +528,7 @@ int core_tpg_deregister(struct se_portal_group *se_tpg)
LIST_HEAD(node_list); LIST_HEAD(node_list);
pr_debug("TARGET_CORE[%s]: Deallocating portal_group for endpoint: %s, " pr_debug("TARGET_CORE[%s]: Deallocating portal_group for endpoint: %s, "
"Proto: %d, Portal Tag: %u\n", tfo->get_fabric_name(), "Proto: %d, Portal Tag: %u\n", tfo->fabric_name,
tfo->tpg_get_wwn(se_tpg) ? tfo->tpg_get_wwn(se_tpg) : NULL, tfo->tpg_get_wwn(se_tpg) ? tfo->tpg_get_wwn(se_tpg) : NULL,
se_tpg->proto_id, tfo->tpg_get_tag(se_tpg)); se_tpg->proto_id, tfo->tpg_get_tag(se_tpg));
......
...@@ -397,7 +397,7 @@ void __transport_register_session( ...@@ -397,7 +397,7 @@ void __transport_register_session(
list_add_tail(&se_sess->sess_list, &se_tpg->tpg_sess_list); list_add_tail(&se_sess->sess_list, &se_tpg->tpg_sess_list);
pr_debug("TARGET_CORE[%s]: Registered fabric_sess_ptr: %p\n", pr_debug("TARGET_CORE[%s]: Registered fabric_sess_ptr: %p\n",
se_tpg->se_tpg_tfo->get_fabric_name(), se_sess->fabric_sess_ptr); se_tpg->se_tpg_tfo->fabric_name, se_sess->fabric_sess_ptr);
} }
EXPORT_SYMBOL(__transport_register_session); EXPORT_SYMBOL(__transport_register_session);
...@@ -602,7 +602,7 @@ void transport_deregister_session(struct se_session *se_sess) ...@@ -602,7 +602,7 @@ void transport_deregister_session(struct se_session *se_sess)
spin_unlock_irqrestore(&se_tpg->session_lock, flags); spin_unlock_irqrestore(&se_tpg->session_lock, flags);
pr_debug("TARGET_CORE[%s]: Deregistered fabric_sess\n", pr_debug("TARGET_CORE[%s]: Deregistered fabric_sess\n",
se_tpg->se_tpg_tfo->get_fabric_name()); se_tpg->se_tpg_tfo->fabric_name);
/* /*
* If last kref is dropping now for an explicit NodeACL, awake sleeping * If last kref is dropping now for an explicit NodeACL, awake sleeping
* ->acl_free_comp caller to wakeup configfs se_node_acl->acl_group * ->acl_free_comp caller to wakeup configfs se_node_acl->acl_group
...@@ -880,7 +880,7 @@ void target_qf_do_work(struct work_struct *work) ...@@ -880,7 +880,7 @@ void target_qf_do_work(struct work_struct *work)
atomic_dec_mb(&dev->dev_qf_count); atomic_dec_mb(&dev->dev_qf_count);
pr_debug("Processing %s cmd: %p QUEUE_FULL in work queue" pr_debug("Processing %s cmd: %p QUEUE_FULL in work queue"
" context: %s\n", cmd->se_tfo->get_fabric_name(), cmd, " context: %s\n", cmd->se_tfo->fabric_name, cmd,
(cmd->t_state == TRANSPORT_COMPLETE_QF_OK) ? "COMPLETE_OK" : (cmd->t_state == TRANSPORT_COMPLETE_QF_OK) ? "COMPLETE_OK" :
(cmd->t_state == TRANSPORT_COMPLETE_QF_WP) ? "WRITE_PENDING" (cmd->t_state == TRANSPORT_COMPLETE_QF_WP) ? "WRITE_PENDING"
: "UNKNOWN"); : "UNKNOWN");
...@@ -1244,7 +1244,7 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size) ...@@ -1244,7 +1244,7 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
} else if (size != cmd->data_length) { } else if (size != cmd->data_length) {
pr_warn_ratelimited("TARGET_CORE[%s]: Expected Transfer Length:" pr_warn_ratelimited("TARGET_CORE[%s]: Expected Transfer Length:"
" %u does not match SCSI CDB Length: %u for SAM Opcode:" " %u does not match SCSI CDB Length: %u for SAM Opcode:"
" 0x%02x\n", cmd->se_tfo->get_fabric_name(), " 0x%02x\n", cmd->se_tfo->fabric_name,
cmd->data_length, size, cmd->t_task_cdb[0]); cmd->data_length, size, cmd->t_task_cdb[0]);
if (cmd->data_direction == DMA_TO_DEVICE) { if (cmd->data_direction == DMA_TO_DEVICE) {
...@@ -1396,7 +1396,7 @@ target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb) ...@@ -1396,7 +1396,7 @@ target_setup_cmd_from_cdb(struct se_cmd *cmd, unsigned char *cdb)
ret = dev->transport->parse_cdb(cmd); ret = dev->transport->parse_cdb(cmd);
if (ret == TCM_UNSUPPORTED_SCSI_OPCODE) if (ret == TCM_UNSUPPORTED_SCSI_OPCODE)
pr_warn_ratelimited("%s/%s: Unsupported SCSI Opcode 0x%02x, sending CHECK_CONDITION.\n", pr_warn_ratelimited("%s/%s: Unsupported SCSI Opcode 0x%02x, sending CHECK_CONDITION.\n",
cmd->se_tfo->get_fabric_name(), cmd->se_tfo->fabric_name,
cmd->se_sess->se_node_acl->initiatorname, cmd->se_sess->se_node_acl->initiatorname,
cmd->t_task_cdb[0]); cmd->t_task_cdb[0]);
if (ret) if (ret)
......
...@@ -266,7 +266,7 @@ bool core_scsi3_ua_for_check_condition(struct se_cmd *cmd, u8 *key, u8 *asc, ...@@ -266,7 +266,7 @@ bool core_scsi3_ua_for_check_condition(struct se_cmd *cmd, u8 *key, u8 *asc,
pr_debug("[%s]: %s UNIT ATTENTION condition with" pr_debug("[%s]: %s UNIT ATTENTION condition with"
" INTLCK_CTRL: %d, mapped LUN: %llu, got CDB: 0x%02x" " INTLCK_CTRL: %d, mapped LUN: %llu, got CDB: 0x%02x"
" reported ASC: 0x%02x, ASCQ: 0x%02x\n", " reported ASC: 0x%02x, ASCQ: 0x%02x\n",
nacl->se_tpg->se_tpg_tfo->get_fabric_name(), nacl->se_tpg->se_tpg_tfo->fabric_name,
(dev->dev_attrib.emulate_ua_intlck_ctrl != 0) ? "Reporting" : (dev->dev_attrib.emulate_ua_intlck_ctrl != 0) ? "Reporting" :
"Releasing", dev->dev_attrib.emulate_ua_intlck_ctrl, "Releasing", dev->dev_attrib.emulate_ua_intlck_ctrl,
cmd->orig_fe_lun, cmd->t_task_cdb[0], *asc, *ascq); cmd->orig_fe_lun, cmd->t_task_cdb[0], *asc, *ascq);
...@@ -327,7 +327,7 @@ int core_scsi3_ua_clear_for_request_sense( ...@@ -327,7 +327,7 @@ int core_scsi3_ua_clear_for_request_sense(
pr_debug("[%s]: Released UNIT ATTENTION condition, mapped" pr_debug("[%s]: Released UNIT ATTENTION condition, mapped"
" LUN: %llu, got REQUEST_SENSE reported ASC: 0x%02x," " LUN: %llu, got REQUEST_SENSE reported ASC: 0x%02x,"
" ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->get_fabric_name(), " ASCQ: 0x%02x\n", nacl->se_tpg->se_tpg_tfo->fabric_name,
cmd->orig_fe_lun, *asc, *ascq); cmd->orig_fe_lun, *asc, *ascq);
return (head) ? -EPERM : 0; return (head) ? -EPERM : 0;
......
...@@ -399,11 +399,6 @@ struct se_portal_group xcopy_pt_tpg; ...@@ -399,11 +399,6 @@ struct se_portal_group xcopy_pt_tpg;
static struct se_session xcopy_pt_sess; static struct se_session xcopy_pt_sess;
static struct se_node_acl xcopy_pt_nacl; static struct se_node_acl xcopy_pt_nacl;
static char *xcopy_pt_get_fabric_name(void)
{
return "xcopy-pt";
}
static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd)
{ {
return 0; return 0;
...@@ -463,7 +458,7 @@ static int xcopy_pt_queue_status(struct se_cmd *se_cmd) ...@@ -463,7 +458,7 @@ static int xcopy_pt_queue_status(struct se_cmd *se_cmd)
} }
static const struct target_core_fabric_ops xcopy_pt_tfo = { static const struct target_core_fabric_ops xcopy_pt_tfo = {
.get_fabric_name = xcopy_pt_get_fabric_name, .fabric_name = "xcopy-pt",
.get_cmd_state = xcopy_pt_get_cmd_state, .get_cmd_state = xcopy_pt_get_cmd_state,
.release_cmd = xcopy_pt_release_cmd, .release_cmd = xcopy_pt_release_cmd,
.check_stop_free = xcopy_pt_check_stop_free, .check_stop_free = xcopy_pt_check_stop_free,
......
...@@ -392,11 +392,6 @@ static inline struct ft_tpg *ft_tpg(struct se_portal_group *se_tpg) ...@@ -392,11 +392,6 @@ static inline struct ft_tpg *ft_tpg(struct se_portal_group *se_tpg)
return container_of(se_tpg, struct ft_tpg, se_tpg); return container_of(se_tpg, struct ft_tpg, se_tpg);
} }
static char *ft_get_fabric_name(void)
{
return "fc";
}
static char *ft_get_fabric_wwn(struct se_portal_group *se_tpg) static char *ft_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
return ft_tpg(se_tpg)->lport_wwn->name; return ft_tpg(se_tpg)->lport_wwn->name;
...@@ -428,8 +423,8 @@ static u32 ft_tpg_get_inst_index(struct se_portal_group *se_tpg) ...@@ -428,8 +423,8 @@ static u32 ft_tpg_get_inst_index(struct se_portal_group *se_tpg)
static const struct target_core_fabric_ops ft_fabric_ops = { static const struct target_core_fabric_ops ft_fabric_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "fc", .name = "fc",
.fabric_name = "fc",
.node_acl_size = sizeof(struct ft_node_acl), .node_acl_size = sizeof(struct ft_node_acl),
.get_fabric_name = ft_get_fabric_name,
.tpg_get_wwn = ft_get_fabric_wwn, .tpg_get_wwn = ft_get_fabric_wwn,
.tpg_get_tag = ft_get_tag, .tpg_get_tag = ft_get_tag,
.tpg_check_demo_mode = ft_check_false, .tpg_check_demo_mode = ft_check_false,
......
...@@ -1256,11 +1256,6 @@ static int usbg_check_false(struct se_portal_group *se_tpg) ...@@ -1256,11 +1256,6 @@ static int usbg_check_false(struct se_portal_group *se_tpg)
return 0; return 0;
} }
static char *usbg_get_fabric_name(void)
{
return "usb_gadget";
}
static char *usbg_get_fabric_wwn(struct se_portal_group *se_tpg) static char *usbg_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
struct usbg_tpg *tpg = container_of(se_tpg, struct usbg_tpg *tpg = container_of(se_tpg,
...@@ -1719,7 +1714,7 @@ static int usbg_check_stop_free(struct se_cmd *se_cmd) ...@@ -1719,7 +1714,7 @@ static int usbg_check_stop_free(struct se_cmd *se_cmd)
static const struct target_core_fabric_ops usbg_ops = { static const struct target_core_fabric_ops usbg_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "usb_gadget", .name = "usb_gadget",
.get_fabric_name = usbg_get_fabric_name, .fabric_name = "usb_gadget",
.tpg_get_wwn = usbg_get_fabric_wwn, .tpg_get_wwn = usbg_get_fabric_wwn,
.tpg_get_tag = usbg_get_tag, .tpg_get_tag = usbg_get_tag,
.tpg_check_demo_mode = usbg_check_true, .tpg_check_demo_mode = usbg_check_true,
......
...@@ -285,11 +285,6 @@ static int vhost_scsi_check_false(struct se_portal_group *se_tpg) ...@@ -285,11 +285,6 @@ static int vhost_scsi_check_false(struct se_portal_group *se_tpg)
return 0; return 0;
} }
static char *vhost_scsi_get_fabric_name(void)
{
return "vhost";
}
static char *vhost_scsi_get_fabric_wwn(struct se_portal_group *se_tpg) static char *vhost_scsi_get_fabric_wwn(struct se_portal_group *se_tpg)
{ {
struct vhost_scsi_tpg *tpg = container_of(se_tpg, struct vhost_scsi_tpg *tpg = container_of(se_tpg,
...@@ -2290,7 +2285,7 @@ static struct configfs_attribute *vhost_scsi_wwn_attrs[] = { ...@@ -2290,7 +2285,7 @@ static struct configfs_attribute *vhost_scsi_wwn_attrs[] = {
static const struct target_core_fabric_ops vhost_scsi_ops = { static const struct target_core_fabric_ops vhost_scsi_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "vhost", .name = "vhost",
.get_fabric_name = vhost_scsi_get_fabric_name, .fabric_name = "vhost",
.tpg_get_wwn = vhost_scsi_get_fabric_wwn, .tpg_get_wwn = vhost_scsi_get_fabric_wwn,
.tpg_get_tag = vhost_scsi_get_tpgt, .tpg_get_tag = vhost_scsi_get_tpgt,
.tpg_check_demo_mode = vhost_scsi_check_true, .tpg_check_demo_mode = vhost_scsi_check_true,
......
...@@ -1712,11 +1712,6 @@ static struct configfs_attribute *scsiback_wwn_attrs[] = { ...@@ -1712,11 +1712,6 @@ static struct configfs_attribute *scsiback_wwn_attrs[] = {
NULL, NULL,
}; };
static char *scsiback_get_fabric_name(void)
{
return "xen-pvscsi";
}
static int scsiback_port_link(struct se_portal_group *se_tpg, static int scsiback_port_link(struct se_portal_group *se_tpg,
struct se_lun *lun) struct se_lun *lun)
{ {
...@@ -1811,7 +1806,7 @@ static int scsiback_check_false(struct se_portal_group *se_tpg) ...@@ -1811,7 +1806,7 @@ static int scsiback_check_false(struct se_portal_group *se_tpg)
static const struct target_core_fabric_ops scsiback_ops = { static const struct target_core_fabric_ops scsiback_ops = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "xen-pvscsi", .name = "xen-pvscsi",
.get_fabric_name = scsiback_get_fabric_name, .fabric_name = "xen-pvscsi",
.tpg_get_wwn = scsiback_get_fabric_wwn, .tpg_get_wwn = scsiback_get_fabric_wwn,
.tpg_get_tag = scsiback_get_tag, .tpg_get_tag = scsiback_get_tag,
.tpg_check_demo_mode = scsiback_check_true, .tpg_check_demo_mode = scsiback_check_true,
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
struct target_core_fabric_ops { struct target_core_fabric_ops {
struct module *module; struct module *module;
const char *name; const char *name;
/*
* fabric_name is used for the ALUA state path and is stored on disk
* with PR state.
*/
const char *fabric_name;
size_t node_acl_size; size_t node_acl_size;
/* /*
* Limits number of scatterlist entries per SCF_SCSI_DATA_CDB payload. * Limits number of scatterlist entries per SCF_SCSI_DATA_CDB payload.
...@@ -23,7 +28,6 @@ struct target_core_fabric_ops { ...@@ -23,7 +28,6 @@ struct target_core_fabric_ops {
* XXX: Currently assumes single PAGE_SIZE per scatterlist entry * XXX: Currently assumes single PAGE_SIZE per scatterlist entry
*/ */
u32 max_data_sg_nents; u32 max_data_sg_nents;
char *(*get_fabric_name)(void);
char *(*tpg_get_wwn)(struct se_portal_group *); char *(*tpg_get_wwn)(struct se_portal_group *);
u16 (*tpg_get_tag)(struct se_portal_group *); u16 (*tpg_get_tag)(struct se_portal_group *);
u32 (*tpg_get_default_depth)(struct se_portal_group *); u32 (*tpg_get_default_depth)(struct se_portal_group *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment