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;
......
...@@ -235,7 +235,7 @@ target_scsi2_reservation_release(struct se_cmd *cmd) ...@@ -235,7 +235,7 @@ target_scsi2_reservation_release(struct se_cmd *cmd)
tpg = sess->se_tpg; tpg = sess->se_tpg;
pr_debug("SCSI-2 Released reservation for %s LUN: %llu ->" pr_debug("SCSI-2 Released reservation for %s LUN: %llu ->"
" MAPPED LUN: %llu for %s\n", " MAPPED LUN: %llu for %s\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
cmd->se_lun->unpacked_lun, cmd->orig_fe_lun, cmd->se_lun->unpacked_lun, cmd->orig_fe_lun,
sess->se_node_acl->initiatorname); sess->se_node_acl->initiatorname);
...@@ -278,7 +278,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd) ...@@ -278,7 +278,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd)
if (dev->dev_reserved_node_acl && if (dev->dev_reserved_node_acl &&
(dev->dev_reserved_node_acl != sess->se_node_acl)) { (dev->dev_reserved_node_acl != sess->se_node_acl)) {
pr_err("SCSI-2 RESERVATION CONFLIFT for %s fabric\n", pr_err("SCSI-2 RESERVATION CONFLIFT for %s fabric\n",
tpg->se_tpg_tfo->get_fabric_name()); tpg->se_tpg_tfo->fabric_name);
pr_err("Original reserver LUN: %llu %s\n", pr_err("Original reserver LUN: %llu %s\n",
cmd->se_lun->unpacked_lun, cmd->se_lun->unpacked_lun,
dev->dev_reserved_node_acl->initiatorname); dev->dev_reserved_node_acl->initiatorname);
...@@ -297,7 +297,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd) ...@@ -297,7 +297,7 @@ target_scsi2_reservation_reserve(struct se_cmd *cmd)
dev->dev_reservation_flags |= DRF_SPC2_RESERVATIONS_WITH_ISID; dev->dev_reservation_flags |= DRF_SPC2_RESERVATIONS_WITH_ISID;
} }
pr_debug("SCSI-2 Reserved %s LUN: %llu -> MAPPED LUN: %llu" pr_debug("SCSI-2 Reserved %s LUN: %llu -> MAPPED LUN: %llu"
" for %s\n", tpg->se_tpg_tfo->get_fabric_name(), " for %s\n", tpg->se_tpg_tfo->fabric_name,
cmd->se_lun->unpacked_lun, cmd->orig_fe_lun, cmd->se_lun->unpacked_lun, cmd->orig_fe_lun,
sess->se_node_acl->initiatorname); sess->se_node_acl->initiatorname);
...@@ -914,11 +914,11 @@ static void core_scsi3_aptpl_reserve( ...@@ -914,11 +914,11 @@ static void core_scsi3_aptpl_reserve(
pr_debug("SPC-3 PR [%s] Service Action: APTPL RESERVE created" pr_debug("SPC-3 PR [%s] Service Action: APTPL RESERVE created"
" new reservation holder TYPE: %s ALL_TG_PT: %d\n", " new reservation holder TYPE: %s ALL_TG_PT: %d\n",
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
core_scsi3_pr_dump_type(pr_reg->pr_res_type), core_scsi3_pr_dump_type(pr_reg->pr_res_type),
(pr_reg->pr_reg_all_tg_pt) ? 1 : 0); (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n", pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n",
tpg->se_tpg_tfo->get_fabric_name(), node_acl->initiatorname, tpg->se_tpg_tfo->fabric_name, node_acl->initiatorname,
i_buf); i_buf);
} }
...@@ -1036,19 +1036,19 @@ static void __core_scsi3_dump_registration( ...@@ -1036,19 +1036,19 @@ static void __core_scsi3_dump_registration(
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);
pr_debug("SPC-3 PR [%s] Service Action: REGISTER%s Initiator" pr_debug("SPC-3 PR [%s] Service Action: REGISTER%s Initiator"
" Node: %s%s\n", tfo->get_fabric_name(), (register_type == REGISTER_AND_MOVE) ? " Node: %s%s\n", tfo->fabric_name, (register_type == REGISTER_AND_MOVE) ?
"_AND_MOVE" : (register_type == REGISTER_AND_IGNORE_EXISTING_KEY) ? "_AND_MOVE" : (register_type == REGISTER_AND_IGNORE_EXISTING_KEY) ?
"_AND_IGNORE_EXISTING_KEY" : "", nacl->initiatorname, "_AND_IGNORE_EXISTING_KEY" : "", nacl->initiatorname,
i_buf); i_buf);
pr_debug("SPC-3 PR [%s] registration on Target Port: %s,0x%04x\n", pr_debug("SPC-3 PR [%s] registration on Target Port: %s,0x%04x\n",
tfo->get_fabric_name(), tfo->tpg_get_wwn(se_tpg), tfo->fabric_name, tfo->tpg_get_wwn(se_tpg),
tfo->tpg_get_tag(se_tpg)); tfo->tpg_get_tag(se_tpg));
pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target" pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
" Port(s)\n", tfo->get_fabric_name(), " Port(s)\n", tfo->fabric_name,
(pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE", (pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE",
dev->transport->name); dev->transport->name);
pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:" pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
" 0x%08x APTPL: %d\n", tfo->get_fabric_name(), " 0x%08x APTPL: %d\n", tfo->fabric_name,
pr_reg->pr_res_key, pr_reg->pr_res_generation, pr_reg->pr_res_key, pr_reg->pr_res_generation,
pr_reg->pr_reg_aptpl); pr_reg->pr_reg_aptpl);
} }
...@@ -1329,7 +1329,7 @@ static void __core_scsi3_free_registration( ...@@ -1329,7 +1329,7 @@ static void __core_scsi3_free_registration(
*/ */
while (atomic_read(&pr_reg->pr_res_holders) != 0) { while (atomic_read(&pr_reg->pr_res_holders) != 0) {
pr_debug("SPC-3 PR [%s] waiting for pr_res_holders\n", pr_debug("SPC-3 PR [%s] waiting for pr_res_holders\n",
tfo->get_fabric_name()); tfo->fabric_name);
cpu_relax(); cpu_relax();
} }
...@@ -1341,15 +1341,15 @@ static void __core_scsi3_free_registration( ...@@ -1341,15 +1341,15 @@ static void __core_scsi3_free_registration(
spin_lock(&pr_tmpl->registration_lock); spin_lock(&pr_tmpl->registration_lock);
pr_debug("SPC-3 PR [%s] Service Action: UNREGISTER Initiator" pr_debug("SPC-3 PR [%s] Service Action: UNREGISTER Initiator"
" Node: %s%s\n", tfo->get_fabric_name(), " Node: %s%s\n", tfo->fabric_name,
pr_reg->pr_reg_nacl->initiatorname, pr_reg->pr_reg_nacl->initiatorname,
i_buf); i_buf);
pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target" pr_debug("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
" Port(s)\n", tfo->get_fabric_name(), " Port(s)\n", tfo->fabric_name,
(pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE", (pr_reg->pr_reg_all_tg_pt) ? "ALL" : "SINGLE",
dev->transport->name); dev->transport->name);
pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:" pr_debug("SPC-3 PR [%s] SA Res Key: 0x%016Lx PRgeneration:"
" 0x%08x\n", tfo->get_fabric_name(), pr_reg->pr_res_key, " 0x%08x\n", tfo->fabric_name, pr_reg->pr_res_key,
pr_reg->pr_res_generation); pr_reg->pr_res_generation);
if (!preempt_and_abort_list) { if (!preempt_and_abort_list) {
...@@ -1645,7 +1645,7 @@ core_scsi3_decode_spec_i_port( ...@@ -1645,7 +1645,7 @@ core_scsi3_decode_spec_i_port(
dest_tpg = tmp_tpg; dest_tpg = tmp_tpg;
pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node:" pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node:"
" %s Port RTPI: %hu\n", " %s Port RTPI: %hu\n",
dest_tpg->se_tpg_tfo->get_fabric_name(), dest_tpg->se_tpg_tfo->fabric_name,
dest_node_acl->initiatorname, dest_rtpi); dest_node_acl->initiatorname, dest_rtpi);
spin_lock(&dev->se_port_lock); spin_lock(&dev->se_port_lock);
...@@ -1662,7 +1662,7 @@ core_scsi3_decode_spec_i_port( ...@@ -1662,7 +1662,7 @@ core_scsi3_decode_spec_i_port(
pr_debug("SPC-3 PR SPEC_I_PT: Got %s data_length: %u tpdl: %u" pr_debug("SPC-3 PR SPEC_I_PT: Got %s data_length: %u tpdl: %u"
" tid_len: %d for %s + %s\n", " tid_len: %d for %s + %s\n",
dest_tpg->se_tpg_tfo->get_fabric_name(), cmd->data_length, dest_tpg->se_tpg_tfo->fabric_name, cmd->data_length,
tpdl, tid_len, i_str, iport_ptr); tpdl, tid_len, i_str, iport_ptr);
if (tid_len > tpdl) { if (tid_len > tpdl) {
...@@ -1683,7 +1683,7 @@ core_scsi3_decode_spec_i_port( ...@@ -1683,7 +1683,7 @@ core_scsi3_decode_spec_i_port(
if (!dest_se_deve) { if (!dest_se_deve) {
pr_err("Unable to locate %s dest_se_deve" pr_err("Unable to locate %s dest_se_deve"
" from destination RTPI: %hu\n", " from destination RTPI: %hu\n",
dest_tpg->se_tpg_tfo->get_fabric_name(), dest_tpg->se_tpg_tfo->fabric_name,
dest_rtpi); dest_rtpi);
core_scsi3_nodeacl_undepend_item(dest_node_acl); core_scsi3_nodeacl_undepend_item(dest_node_acl);
...@@ -1704,7 +1704,7 @@ core_scsi3_decode_spec_i_port( ...@@ -1704,7 +1704,7 @@ core_scsi3_decode_spec_i_port(
pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node: %s" pr_debug("SPC-3 PR SPEC_I_PT: Located %s Node: %s"
" dest_se_deve mapped_lun: %llu\n", " dest_se_deve mapped_lun: %llu\n",
dest_tpg->se_tpg_tfo->get_fabric_name(), dest_tpg->se_tpg_tfo->fabric_name,
dest_node_acl->initiatorname, dest_se_deve->mapped_lun); dest_node_acl->initiatorname, dest_se_deve->mapped_lun);
/* /*
...@@ -1815,7 +1815,7 @@ core_scsi3_decode_spec_i_port( ...@@ -1815,7 +1815,7 @@ core_scsi3_decode_spec_i_port(
pr_debug("SPC-3 PR [%s] SPEC_I_PT: Successfully" pr_debug("SPC-3 PR [%s] SPEC_I_PT: Successfully"
" registered Transport ID for Node: %s%s Mapped LUN:" " registered Transport ID for Node: %s%s Mapped LUN:"
" %llu\n", dest_tpg->se_tpg_tfo->get_fabric_name(), " %llu\n", dest_tpg->se_tpg_tfo->fabric_name,
dest_node_acl->initiatorname, i_buf, (dest_se_deve) ? dest_node_acl->initiatorname, i_buf, (dest_se_deve) ?
dest_se_deve->mapped_lun : 0); dest_se_deve->mapped_lun : 0);
...@@ -1913,7 +1913,7 @@ static int core_scsi3_update_aptpl_buf( ...@@ -1913,7 +1913,7 @@ static int core_scsi3_update_aptpl_buf(
"res_holder=1\nres_type=%02x\n" "res_holder=1\nres_type=%02x\n"
"res_scope=%02x\nres_all_tg_pt=%d\n" "res_scope=%02x\nres_all_tg_pt=%d\n"
"mapped_lun=%llu\n", reg_count, "mapped_lun=%llu\n", reg_count,
tpg->se_tpg_tfo->get_fabric_name(), tpg->se_tpg_tfo->fabric_name,
pr_reg->pr_reg_nacl->initiatorname, isid_buf, pr_reg->pr_reg_nacl->initiatorname, isid_buf,
pr_reg->pr_res_key, pr_reg->pr_res_type, pr_reg->pr_res_key, pr_reg->pr_res_type,
pr_reg->pr_res_scope, pr_reg->pr_reg_all_tg_pt, pr_reg->pr_res_scope, pr_reg->pr_reg_all_tg_pt,
...@@ -1923,7 +1923,7 @@ static int core_scsi3_update_aptpl_buf( ...@@ -1923,7 +1923,7 @@ static int core_scsi3_update_aptpl_buf(
"initiator_fabric=%s\ninitiator_node=%s\n%s" "initiator_fabric=%s\ninitiator_node=%s\n%s"
"sa_res_key=%llu\nres_holder=0\n" "sa_res_key=%llu\nres_holder=0\n"
"res_all_tg_pt=%d\nmapped_lun=%llu\n", "res_all_tg_pt=%d\nmapped_lun=%llu\n",
reg_count, tpg->se_tpg_tfo->get_fabric_name(), reg_count, tpg->se_tpg_tfo->fabric_name,
pr_reg->pr_reg_nacl->initiatorname, isid_buf, pr_reg->pr_reg_nacl->initiatorname, isid_buf,
pr_reg->pr_res_key, pr_reg->pr_reg_all_tg_pt, pr_reg->pr_res_key, pr_reg->pr_reg_all_tg_pt,
pr_reg->pr_res_mapped_lun); pr_reg->pr_res_mapped_lun);
...@@ -1942,7 +1942,7 @@ static int core_scsi3_update_aptpl_buf( ...@@ -1942,7 +1942,7 @@ static int core_scsi3_update_aptpl_buf(
*/ */
snprintf(tmp, 512, "target_fabric=%s\ntarget_node=%s\n" snprintf(tmp, 512, "target_fabric=%s\ntarget_node=%s\n"
"tpgt=%hu\nport_rtpi=%hu\ntarget_lun=%llu\nPR_REG_END:" "tpgt=%hu\nport_rtpi=%hu\ntarget_lun=%llu\nPR_REG_END:"
" %d\n", tpg->se_tpg_tfo->get_fabric_name(), " %d\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),
pr_reg->tg_pt_sep_rtpi, pr_reg->pr_aptpl_target_lun, pr_reg->tg_pt_sep_rtpi, pr_reg->pr_aptpl_target_lun,
...@@ -2168,7 +2168,7 @@ core_scsi3_emulate_pro_register(struct se_cmd *cmd, u64 res_key, u64 sa_res_key, ...@@ -2168,7 +2168,7 @@ core_scsi3_emulate_pro_register(struct se_cmd *cmd, u64 res_key, u64 sa_res_key,
pr_reg->pr_res_key = sa_res_key; pr_reg->pr_res_key = sa_res_key;
pr_debug("SPC-3 PR [%s] REGISTER%s: Changed Reservation" pr_debug("SPC-3 PR [%s] REGISTER%s: Changed Reservation"
" Key for %s to: 0x%016Lx PRgeneration:" " Key for %s to: 0x%016Lx PRgeneration:"
" 0x%08x\n", cmd->se_tfo->get_fabric_name(), " 0x%08x\n", cmd->se_tfo->fabric_name,
(register_type == REGISTER_AND_IGNORE_EXISTING_KEY) ? "_AND_IGNORE_EXISTING_KEY" : "", (register_type == REGISTER_AND_IGNORE_EXISTING_KEY) ? "_AND_IGNORE_EXISTING_KEY" : "",
pr_reg->pr_reg_nacl->initiatorname, pr_reg->pr_reg_nacl->initiatorname,
pr_reg->pr_res_key, pr_reg->pr_res_generation); pr_reg->pr_res_key, pr_reg->pr_res_generation);
...@@ -2356,9 +2356,9 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key) ...@@ -2356,9 +2356,9 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
pr_err("SPC-3 PR: Attempted RESERVE from" pr_err("SPC-3 PR: Attempted RESERVE from"
" [%s]: %s while reservation already held by" " [%s]: %s while reservation already held by"
" [%s]: %s, returning RESERVATION_CONFLICT\n", " [%s]: %s, returning RESERVATION_CONFLICT\n",
cmd->se_tfo->get_fabric_name(), cmd->se_tfo->fabric_name,
se_sess->se_node_acl->initiatorname, se_sess->se_node_acl->initiatorname,
pr_res_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), pr_res_nacl->se_tpg->se_tpg_tfo->fabric_name,
pr_res_holder->pr_reg_nacl->initiatorname); pr_res_holder->pr_reg_nacl->initiatorname);
spin_unlock(&dev->dev_reservation_lock); spin_unlock(&dev->dev_reservation_lock);
...@@ -2379,9 +2379,9 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key) ...@@ -2379,9 +2379,9 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
" [%s]: %s trying to change TYPE and/or SCOPE," " [%s]: %s trying to change TYPE and/or SCOPE,"
" while reservation already held by [%s]: %s," " while reservation already held by [%s]: %s,"
" returning RESERVATION_CONFLICT\n", " returning RESERVATION_CONFLICT\n",
cmd->se_tfo->get_fabric_name(), cmd->se_tfo->fabric_name,
se_sess->se_node_acl->initiatorname, se_sess->se_node_acl->initiatorname,
pr_res_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), pr_res_nacl->se_tpg->se_tpg_tfo->fabric_name,
pr_res_holder->pr_reg_nacl->initiatorname); pr_res_holder->pr_reg_nacl->initiatorname);
spin_unlock(&dev->dev_reservation_lock); spin_unlock(&dev->dev_reservation_lock);
...@@ -2414,10 +2414,10 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key) ...@@ -2414,10 +2414,10 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
pr_debug("SPC-3 PR [%s] Service Action: RESERVE created new" pr_debug("SPC-3 PR [%s] Service Action: RESERVE created new"
" reservation holder TYPE: %s ALL_TG_PT: %d\n", " reservation holder TYPE: %s ALL_TG_PT: %d\n",
cmd->se_tfo->get_fabric_name(), core_scsi3_pr_dump_type(type), cmd->se_tfo->fabric_name, core_scsi3_pr_dump_type(type),
(pr_reg->pr_reg_all_tg_pt) ? 1 : 0); (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n", pr_debug("SPC-3 PR [%s] RESERVE Node: %s%s\n",
cmd->se_tfo->get_fabric_name(), cmd->se_tfo->fabric_name,
se_sess->se_node_acl->initiatorname, se_sess->se_node_acl->initiatorname,
i_buf); i_buf);
spin_unlock(&dev->dev_reservation_lock); spin_unlock(&dev->dev_reservation_lock);
...@@ -2506,12 +2506,12 @@ static void __core_scsi3_complete_pro_release( ...@@ -2506,12 +2506,12 @@ static void __core_scsi3_complete_pro_release(
if (!dev->dev_pr_res_holder) { if (!dev->dev_pr_res_holder) {
pr_debug("SPC-3 PR [%s] Service Action: %s RELEASE cleared" pr_debug("SPC-3 PR [%s] Service Action: %s RELEASE cleared"
" reservation holder TYPE: %s ALL_TG_PT: %d\n", " reservation holder TYPE: %s ALL_TG_PT: %d\n",
tfo->get_fabric_name(), (explicit) ? "explicit" : tfo->fabric_name, (explicit) ? "explicit" :
"implicit", core_scsi3_pr_dump_type(pr_res_type), "implicit", core_scsi3_pr_dump_type(pr_res_type),
(pr_reg->pr_reg_all_tg_pt) ? 1 : 0); (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
} }
pr_debug("SPC-3 PR [%s] RELEASE Node: %s%s\n", pr_debug("SPC-3 PR [%s] RELEASE Node: %s%s\n",
tfo->get_fabric_name(), se_nacl->initiatorname, tfo->fabric_name, se_nacl->initiatorname,
i_buf); i_buf);
/* /*
* Clear TYPE and SCOPE for the next PROUT Service Action: RESERVE * Clear TYPE and SCOPE for the next PROUT Service Action: RESERVE
...@@ -2609,9 +2609,9 @@ core_scsi3_emulate_pro_release(struct se_cmd *cmd, int type, int scope, ...@@ -2609,9 +2609,9 @@ core_scsi3_emulate_pro_release(struct se_cmd *cmd, int type, int scope,
" reservation from [%s]: %s with different TYPE " " reservation from [%s]: %s with different TYPE "
"and/or SCOPE while reservation already held by" "and/or SCOPE while reservation already held by"
" [%s]: %s, returning RESERVATION_CONFLICT\n", " [%s]: %s, returning RESERVATION_CONFLICT\n",
cmd->se_tfo->get_fabric_name(), cmd->se_tfo->fabric_name,
se_sess->se_node_acl->initiatorname, se_sess->se_node_acl->initiatorname,
pr_res_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), pr_res_nacl->se_tpg->se_tpg_tfo->fabric_name,
pr_res_holder->pr_reg_nacl->initiatorname); pr_res_holder->pr_reg_nacl->initiatorname);
spin_unlock(&dev->dev_reservation_lock); spin_unlock(&dev->dev_reservation_lock);
...@@ -2752,7 +2752,7 @@ core_scsi3_emulate_pro_clear(struct se_cmd *cmd, u64 res_key) ...@@ -2752,7 +2752,7 @@ core_scsi3_emulate_pro_clear(struct se_cmd *cmd, u64 res_key)
spin_unlock(&pr_tmpl->registration_lock); spin_unlock(&pr_tmpl->registration_lock);
pr_debug("SPC-3 PR [%s] Service Action: CLEAR complete\n", pr_debug("SPC-3 PR [%s] Service Action: CLEAR complete\n",
cmd->se_tfo->get_fabric_name()); cmd->se_tfo->fabric_name);
core_scsi3_update_and_write_aptpl(cmd->se_dev, false); core_scsi3_update_and_write_aptpl(cmd->se_dev, false);
...@@ -2791,11 +2791,11 @@ static void __core_scsi3_complete_pro_preempt( ...@@ -2791,11 +2791,11 @@ static void __core_scsi3_complete_pro_preempt(
pr_debug("SPC-3 PR [%s] Service Action: PREEMPT%s created new" pr_debug("SPC-3 PR [%s] Service Action: PREEMPT%s created new"
" reservation holder TYPE: %s ALL_TG_PT: %d\n", " reservation holder TYPE: %s ALL_TG_PT: %d\n",
tfo->get_fabric_name(), (preempt_type == PREEMPT_AND_ABORT) ? "_AND_ABORT" : "", tfo->fabric_name, (preempt_type == PREEMPT_AND_ABORT) ? "_AND_ABORT" : "",
core_scsi3_pr_dump_type(type), core_scsi3_pr_dump_type(type),
(pr_reg->pr_reg_all_tg_pt) ? 1 : 0); (pr_reg->pr_reg_all_tg_pt) ? 1 : 0);
pr_debug("SPC-3 PR [%s] PREEMPT%s from Node: %s%s\n", pr_debug("SPC-3 PR [%s] PREEMPT%s from Node: %s%s\n",
tfo->get_fabric_name(), (preempt_type == PREEMPT_AND_ABORT) ? "_AND_ABORT" : "", tfo->fabric_name, (preempt_type == PREEMPT_AND_ABORT) ? "_AND_ABORT" : "",
nacl->initiatorname, i_buf); nacl->initiatorname, i_buf);
/* /*
* For PREEMPT_AND_ABORT, add the preempting reservation's * For PREEMPT_AND_ABORT, add the preempting reservation's
...@@ -3282,7 +3282,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3282,7 +3282,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
" proto_ident: 0x%02x does not match ident: 0x%02x" " proto_ident: 0x%02x does not match ident: 0x%02x"
" from fabric: %s\n", proto_ident, " from fabric: %s\n", proto_ident,
dest_se_tpg->proto_id, dest_se_tpg->proto_id,
dest_tf_ops->get_fabric_name()); dest_tf_ops->fabric_name);
ret = TCM_INVALID_PARAMETER_LIST; ret = TCM_INVALID_PARAMETER_LIST;
goto out; goto out;
} }
...@@ -3299,7 +3299,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3299,7 +3299,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
buf = NULL; buf = NULL;
pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s" pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s"
" %s\n", dest_tf_ops->get_fabric_name(), (iport_ptr != NULL) ? " %s\n", dest_tf_ops->fabric_name, (iport_ptr != NULL) ?
"port" : "device", initiator_str, (iport_ptr != NULL) ? "port" : "device", initiator_str, (iport_ptr != NULL) ?
iport_ptr : ""); iport_ptr : "");
/* /*
...@@ -3344,7 +3344,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3344,7 +3344,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
if (!dest_node_acl) { if (!dest_node_acl) {
pr_err("Unable to locate %s dest_node_acl for" pr_err("Unable to locate %s dest_node_acl for"
" TransportID%s\n", dest_tf_ops->get_fabric_name(), " TransportID%s\n", dest_tf_ops->fabric_name,
initiator_str); initiator_str);
ret = TCM_INVALID_PARAMETER_LIST; ret = TCM_INVALID_PARAMETER_LIST;
goto out; goto out;
...@@ -3360,7 +3360,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3360,7 +3360,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
} }
pr_debug("SPC-3 PR REGISTER_AND_MOVE: Found %s dest_node_acl:" pr_debug("SPC-3 PR REGISTER_AND_MOVE: Found %s dest_node_acl:"
" %s from TransportID\n", dest_tf_ops->get_fabric_name(), " %s from TransportID\n", dest_tf_ops->fabric_name,
dest_node_acl->initiatorname); dest_node_acl->initiatorname);
/* /*
...@@ -3370,7 +3370,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3370,7 +3370,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
dest_se_deve = core_get_se_deve_from_rtpi(dest_node_acl, rtpi); dest_se_deve = core_get_se_deve_from_rtpi(dest_node_acl, rtpi);
if (!dest_se_deve) { if (!dest_se_deve) {
pr_err("Unable to locate %s dest_se_deve from RTPI:" pr_err("Unable to locate %s dest_se_deve from RTPI:"
" %hu\n", dest_tf_ops->get_fabric_name(), rtpi); " %hu\n", dest_tf_ops->fabric_name, rtpi);
ret = TCM_INVALID_PARAMETER_LIST; ret = TCM_INVALID_PARAMETER_LIST;
goto out; goto out;
} }
...@@ -3385,7 +3385,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3385,7 +3385,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
pr_debug("SPC-3 PR REGISTER_AND_MOVE: Located %s node %s LUN" pr_debug("SPC-3 PR REGISTER_AND_MOVE: Located %s node %s LUN"
" ACL for dest_se_deve->mapped_lun: %llu\n", " ACL for dest_se_deve->mapped_lun: %llu\n",
dest_tf_ops->get_fabric_name(), dest_node_acl->initiatorname, dest_tf_ops->fabric_name, dest_node_acl->initiatorname,
dest_se_deve->mapped_lun); dest_se_deve->mapped_lun);
/* /*
...@@ -3501,13 +3501,13 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key, ...@@ -3501,13 +3501,13 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
pr_debug("SPC-3 PR [%s] Service Action: REGISTER_AND_MOVE" pr_debug("SPC-3 PR [%s] Service Action: REGISTER_AND_MOVE"
" created new reservation holder TYPE: %s on object RTPI:" " created new reservation holder TYPE: %s on object RTPI:"
" %hu PRGeneration: 0x%08x\n", dest_tf_ops->get_fabric_name(), " %hu PRGeneration: 0x%08x\n", dest_tf_ops->fabric_name,
core_scsi3_pr_dump_type(type), rtpi, core_scsi3_pr_dump_type(type), rtpi,
dest_pr_reg->pr_res_generation); dest_pr_reg->pr_res_generation);
pr_debug("SPC-3 PR Successfully moved reservation from" pr_debug("SPC-3 PR Successfully moved reservation from"
" %s Fabric Node: %s%s -> %s Fabric Node: %s %s\n", " %s Fabric Node: %s%s -> %s Fabric Node: %s %s\n",
tf_ops->get_fabric_name(), pr_reg_nacl->initiatorname, tf_ops->fabric_name, pr_reg_nacl->initiatorname,
i_buf, dest_tf_ops->get_fabric_name(), i_buf, dest_tf_ops->fabric_name,
dest_node_acl->initiatorname, (iport_ptr != NULL) ? dest_node_acl->initiatorname, (iport_ptr != NULL) ?
iport_ptr : ""); iport_ptr : "");
/* /*
......
...@@ -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