diff options
| author | David Disseldorp <ddiss@suse.de> | 2018-11-23 12:36:12 -0500 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-11-28 18:50:58 -0500 |
| commit | 30c7ca9350048486ab32fdb9f5f6ed0603bba39a (patch) | |
| tree | 5fdac4a507e94a69287d57900faa095b253d2661 /drivers/target/target_core_configfs.c | |
| parent | 6baca7601bdee2e57f20c45d63eb53b89b33e816 (diff) | |
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: David Disseldorp <ddiss@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
| -rw-r--r-- | drivers/target/target_core_configfs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 62427acdf503..ae6c44c48f75 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
| @@ -351,8 +351,8 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo) | |||
| 351 | "_NAME_SIZE\n", tfo->name); | 351 | "_NAME_SIZE\n", tfo->name); |
| 352 | return -EINVAL; | 352 | return -EINVAL; |
| 353 | } | 353 | } |
| 354 | if (!tfo->get_fabric_name) { | 354 | if (!tfo->fabric_name) { |
| 355 | pr_err("Missing tfo->get_fabric_name()\n"); | 355 | pr_err("Missing tfo->fabric_name\n"); |
| 356 | return -EINVAL; | 356 | return -EINVAL; |
| 357 | } | 357 | } |
| 358 | if (!tfo->tpg_get_wwn) { | 358 | if (!tfo->tpg_get_wwn) { |
| @@ -1403,7 +1403,7 @@ static ssize_t target_core_dev_pr_show_spc3_res(struct se_device *dev, | |||
| 1403 | core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); | 1403 | core_pr_dump_initiator_port(pr_reg, i_buf, PR_REG_ISID_ID_LEN); |
| 1404 | 1404 | ||
| 1405 | return sprintf(page, "SPC-3 Reservation: %s Initiator: %s%s\n", | 1405 | return sprintf(page, "SPC-3 Reservation: %s Initiator: %s%s\n", |
| 1406 | se_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), | 1406 | se_nacl->se_tpg->se_tpg_tfo->fabric_name, |
| 1407 | se_nacl->initiatorname, i_buf); | 1407 | se_nacl->initiatorname, i_buf); |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| @@ -1417,7 +1417,7 @@ static ssize_t target_core_dev_pr_show_spc2_res(struct se_device *dev, | |||
| 1417 | if (se_nacl) { | 1417 | if (se_nacl) { |
| 1418 | len = sprintf(page, | 1418 | len = sprintf(page, |
| 1419 | "SPC-2 Reservation: %s Initiator: %s\n", | 1419 | "SPC-2 Reservation: %s Initiator: %s\n", |
| 1420 | se_nacl->se_tpg->se_tpg_tfo->get_fabric_name(), | 1420 | se_nacl->se_tpg->se_tpg_tfo->fabric_name, |
| 1421 | se_nacl->initiatorname); | 1421 | se_nacl->initiatorname); |
| 1422 | } else { | 1422 | } else { |
| 1423 | len = sprintf(page, "No SPC-2 Reservation holder\n"); | 1423 | 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 | tfo = se_tpg->se_tpg_tfo; | 1495 | tfo = se_tpg->se_tpg_tfo; |
| 1496 | 1496 | ||
| 1497 | len += sprintf(page+len, "SPC-3 Reservation: %s" | 1497 | len += sprintf(page+len, "SPC-3 Reservation: %s" |
| 1498 | " Target Node Endpoint: %s\n", tfo->get_fabric_name(), | 1498 | " Target Node Endpoint: %s\n", tfo->fabric_name, |
| 1499 | tfo->tpg_get_wwn(se_tpg)); | 1499 | tfo->tpg_get_wwn(se_tpg)); |
| 1500 | len += sprintf(page+len, "SPC-3 Reservation: Relative Port" | 1500 | len += sprintf(page+len, "SPC-3 Reservation: Relative Port" |
| 1501 | " Identifier Tag: %hu %s Portal Group Tag: %hu" | 1501 | " Identifier Tag: %hu %s Portal Group Tag: %hu" |
| 1502 | " %s Logical Unit: %llu\n", pr_reg->tg_pt_sep_rtpi, | 1502 | " %s Logical Unit: %llu\n", pr_reg->tg_pt_sep_rtpi, |
| 1503 | tfo->get_fabric_name(), tfo->tpg_get_tag(se_tpg), | 1503 | tfo->fabric_name, tfo->tpg_get_tag(se_tpg), |
| 1504 | tfo->get_fabric_name(), pr_reg->pr_aptpl_target_lun); | 1504 | tfo->fabric_name, pr_reg->pr_aptpl_target_lun); |
| 1505 | 1505 | ||
| 1506 | out_unlock: | 1506 | out_unlock: |
| 1507 | spin_unlock(&dev->dev_reservation_lock); | 1507 | 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 | core_pr_dump_initiator_port(pr_reg, i_buf, | 1532 | core_pr_dump_initiator_port(pr_reg, i_buf, |
| 1533 | PR_REG_ISID_ID_LEN); | 1533 | PR_REG_ISID_ID_LEN); |
| 1534 | sprintf(buf, "%s Node: %s%s Key: 0x%016Lx PRgen: 0x%08x\n", | 1534 | sprintf(buf, "%s Node: %s%s Key: 0x%016Lx PRgen: 0x%08x\n", |
| 1535 | tfo->get_fabric_name(), | 1535 | tfo->fabric_name, |
| 1536 | pr_reg->pr_reg_nacl->initiatorname, i_buf, pr_reg->pr_res_key, | 1536 | pr_reg->pr_reg_nacl->initiatorname, i_buf, pr_reg->pr_res_key, |
| 1537 | pr_reg->pr_res_generation); | 1537 | pr_reg->pr_res_generation); |
| 1538 | 1538 | ||
| @@ -2757,7 +2757,7 @@ static ssize_t target_tg_pt_gp_members_show(struct config_item *item, | |||
| 2757 | struct se_portal_group *tpg = lun->lun_tpg; | 2757 | struct se_portal_group *tpg = lun->lun_tpg; |
| 2758 | 2758 | ||
| 2759 | cur_len = snprintf(buf, TG_PT_GROUP_NAME_BUF, "%s/%s/tpgt_%hu" | 2759 | cur_len = snprintf(buf, TG_PT_GROUP_NAME_BUF, "%s/%s/tpgt_%hu" |
| 2760 | "/%s\n", tpg->se_tpg_tfo->get_fabric_name(), | 2760 | "/%s\n", tpg->se_tpg_tfo->fabric_name, |
| 2761 | tpg->se_tpg_tfo->tpg_get_wwn(tpg), | 2761 | tpg->se_tpg_tfo->tpg_get_wwn(tpg), |
| 2762 | tpg->se_tpg_tfo->tpg_get_tag(tpg), | 2762 | tpg->se_tpg_tfo->tpg_get_tag(tpg), |
| 2763 | config_item_name(&lun->lun_group.cg_item)); | 2763 | config_item_name(&lun->lun_group.cg_item)); |
