Commit 5fe99dac authored by Roman Bolshakov's avatar Roman Bolshakov Committed by Martin K. Petersen

scsi: target: core: Drop device-based RTPI

The code is not needed since target port-based RTPI allocation replaced it.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: default avatarDmitry Bogdanov <d.bogdanov@yadro.com>
Link: https://lore.kernel.org/r/20230301084512.21956-4-d.bogdanov@yadro.comReviewed-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b9e063ad
...@@ -479,47 +479,6 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg) ...@@ -479,47 +479,6 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
mutex_unlock(&tpg->acl_node_mutex); mutex_unlock(&tpg->acl_node_mutex);
} }
int core_alloc_rtpi(struct se_lun *lun, struct se_device *dev)
{
struct se_lun *tmp;
spin_lock(&dev->se_port_lock);
if (dev->export_count == 0x0000ffff) {
pr_warn("Reached dev->dev_port_count =="
" 0x0000ffff\n");
spin_unlock(&dev->se_port_lock);
return -ENOSPC;
}
again:
/*
* Allocate the next RELATIVE TARGET PORT IDENTIFIER for this struct se_device
* Here is the table from spc4r17 section 7.7.3.8.
*
* Table 473 -- RELATIVE TARGET PORT IDENTIFIER field
*
* Code Description
* 0h Reserved
* 1h Relative port 1, historically known as port A
* 2h Relative port 2, historically known as port B
* 3h to FFFFh Relative port 3 through 65 535
*/
lun->lun_rtpi = dev->dev_rpti_counter++;
if (!lun->lun_rtpi)
goto again;
list_for_each_entry(tmp, &dev->dev_sep_list, lun_dev_link) {
/*
* Make sure RELATIVE TARGET PORT IDENTIFIER is unique
* for 16-bit wrap..
*/
if (lun->lun_rtpi == tmp->lun_rtpi)
goto again;
}
spin_unlock(&dev->se_port_lock);
return 0;
}
static void se_release_vpd_for_dev(struct se_device *dev) static void se_release_vpd_for_dev(struct se_device *dev)
{ {
struct t10_vpd *vpd, *vpd_tmp; struct t10_vpd *vpd, *vpd_tmp;
......
...@@ -59,7 +59,6 @@ struct target_fabric_configfs { ...@@ -59,7 +59,6 @@ struct target_fabric_configfs {
extern struct t10_alua_lu_gp *default_lu_gp; extern struct t10_alua_lu_gp *default_lu_gp;
/* target_core_device.c */ /* target_core_device.c */
int core_alloc_rtpi(struct se_lun *lun, struct se_device *dev);
struct se_dev_entry *core_get_se_deve_from_rtpi(struct se_node_acl *, u16); struct se_dev_entry *core_get_se_deve_from_rtpi(struct se_node_acl *, u16);
void target_pr_kref_release(struct kref *); void target_pr_kref_release(struct kref *);
void core_free_device_list_for_node(struct se_node_acl *, void core_free_device_list_for_node(struct se_node_acl *,
......
...@@ -632,10 +632,6 @@ int core_tpg_add_lun( ...@@ -632,10 +632,6 @@ int core_tpg_add_lun(
if (ret < 0) if (ret < 0)
goto out; goto out;
ret = core_alloc_rtpi(lun, dev);
if (ret)
goto out_kill_ref;
if (!(dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_ALUA) && if (!(dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_ALUA) &&
!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) !(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE))
target_attach_tg_pt_gp(lun, dev->t10_alua.default_tg_pt_gp); target_attach_tg_pt_gp(lun, dev->t10_alua.default_tg_pt_gp);
...@@ -659,8 +655,6 @@ int core_tpg_add_lun( ...@@ -659,8 +655,6 @@ int core_tpg_add_lun(
return 0; return 0;
out_kill_ref:
percpu_ref_exit(&lun->lun_ref);
out: out:
return ret; return ret;
} }
......
...@@ -735,8 +735,6 @@ struct se_lun { ...@@ -735,8 +735,6 @@ struct se_lun {
bool lun_access_ro; bool lun_access_ro;
u32 lun_index; u32 lun_index;
/* RELATIVE TARGET PORT IDENTIFER */
u16 lun_rtpi;
atomic_t lun_acl_count; atomic_t lun_acl_count;
struct se_device __rcu *lun_se_dev; struct se_device __rcu *lun_se_dev;
...@@ -788,8 +786,6 @@ struct se_device_queue { ...@@ -788,8 +786,6 @@ struct se_device_queue {
}; };
struct se_device { struct se_device {
/* RELATIVE TARGET PORT IDENTIFER Counter */
u16 dev_rpti_counter;
/* Used for SAM Task Attribute ordering */ /* Used for SAM Task Attribute ordering */
u32 dev_cur_ordered_id; u32 dev_cur_ordered_id;
u32 dev_flags; u32 dev_flags;
......
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