@@ -3344,20 +3344,6 @@ static void srpt_close_session(struct se_session *se_sess)
srpt_disconnect_ch_sync(ch);
}
-/**
- * srpt_sess_get_index - return the value of scsiAttIntrPortIndex (SCSI-MIB)
- * @se_sess: SCSI target session.
- *
- * A quote from RFC 4455 (SCSI-MIB) about this MIB object:
- * This object represents an arbitrary integer used to uniquely identify a
- * particular attached remote initiator port to a particular SCSI target port
- * within a particular SCSI target device within a particular SCSI instance.
- */
-static u32 srpt_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static void srpt_set_default_node_attrs(struct se_node_acl *nacl)
{
}
@@ -3834,7 +3820,6 @@ static ssize_t srpt_wwn_version_show(struct config_item *item, char *buf)
.release_cmd = srpt_release_cmd,
.check_stop_free = srpt_check_stop_free,
.close_session = srpt_close_session,
- .sess_get_index = srpt_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = srpt_write_pending,
.set_default_node_attributes = srpt_set_default_node_attrs,
@@ -3739,11 +3739,6 @@ static void ibmvscsis_release_cmd(struct se_cmd *se_cmd)
spin_unlock_bh(&vscsi->intr_lock);
}
-static u32 ibmvscsis_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
{
struct ibmvscsis_cmd *cmd = container_of(se_cmd, struct ibmvscsis_cmd,
@@ -4034,7 +4029,6 @@ static ssize_t ibmvscsis_tpg_enable_store(struct config_item *item,
.tpg_get_inst_index = ibmvscsis_tpg_get_inst_index,
.check_stop_free = ibmvscsis_check_stop_free,
.release_cmd = ibmvscsis_release_cmd,
- .sess_get_index = ibmvscsis_sess_get_index,
.write_pending = ibmvscsis_write_pending,
.set_default_node_attributes = ibmvscsis_set_default_node_attrs,
.get_cmd_state = ibmvscsis_get_cmd_state,
@@ -377,11 +377,6 @@ static void tcm_qla2xxx_close_session(struct se_session *se_sess)
tcm_qla2xxx_put_sess(sess);
}
-static u32 tcm_qla2xxx_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
{
struct qla_tgt_cmd *cmd = container_of(se_cmd,
@@ -1853,7 +1848,6 @@ static ssize_t tcm_qla2xxx_wwn_version_show(struct config_item *item,
.check_stop_free = tcm_qla2xxx_check_stop_free,
.release_cmd = tcm_qla2xxx_release_cmd,
.close_session = tcm_qla2xxx_close_session,
- .sess_get_index = tcm_qla2xxx_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = tcm_qla2xxx_write_pending,
.set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs,
@@ -1893,7 +1887,6 @@ static ssize_t tcm_qla2xxx_wwn_version_show(struct config_item *item,
.check_stop_free = tcm_qla2xxx_check_stop_free,
.release_cmd = tcm_qla2xxx_release_cmd,
.close_session = tcm_qla2xxx_close_session,
- .sess_get_index = tcm_qla2xxx_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = tcm_qla2xxx_write_pending,
.set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs,
@@ -1342,11 +1342,6 @@ static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
return cmd->i_state;
}
-static u32 lio_sess_get_index(struct se_session *se_sess)
-{
- return se_sess->sid;
-}
-
static u32 lio_sess_get_initiator_sid(
struct se_session *se_sess,
unsigned char *buf,
@@ -1542,7 +1537,6 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
.check_stop_free = lio_check_stop_free,
.release_cmd = lio_release_cmd,
.close_session = lio_tpg_close_session,
- .sess_get_index = lio_sess_get_index,
.sess_get_initiator_sid = lio_sess_get_initiator_sid,
.write_pending = lio_write_pending,
.set_default_node_attributes = lio_set_default_node_attributes,
@@ -512,11 +512,6 @@ static u32 tcm_loop_get_inst_index(struct se_portal_group *se_tpg)
return 1;
}
-static u32 tcm_loop_sess_get_index(struct se_session *se_sess)
-{
- return 1;
-}
-
static void tcm_loop_set_default_node_attributes(struct se_node_acl *se_acl)
{
return;
@@ -1131,7 +1126,6 @@ static ssize_t tcm_loop_wwn_version_show(struct config_item *item, char *page)
.tpg_get_inst_index = tcm_loop_get_inst_index,
.check_stop_free = tcm_loop_check_stop_free,
.release_cmd = tcm_loop_release_cmd,
- .sess_get_index = tcm_loop_sess_get_index,
.write_pending = tcm_loop_write_pending,
.set_default_node_attributes = tcm_loop_set_default_node_attributes,
.get_cmd_state = tcm_loop_get_cmd_state,
@@ -1708,11 +1708,6 @@ static void sbp_release_cmd(struct se_cmd *se_cmd)
sbp_free_request(req);
}
-static u32 sbp_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static int sbp_write_pending(struct se_cmd *se_cmd)
{
struct sbp_target_request *req = container_of(se_cmd,
@@ -2309,7 +2304,6 @@ static ssize_t sbp_tpg_attrib_max_logins_per_lun_store(struct config_item *item,
.tpg_check_prod_mode_write_protect = sbp_check_false,
.tpg_get_inst_index = sbp_tpg_get_inst_index,
.release_cmd = sbp_release_cmd,
- .sess_get_index = sbp_sess_get_index,
.write_pending = sbp_write_pending,
.set_default_node_attributes = sbp_set_default_node_attrs,
.get_cmd_state = sbp_get_cmd_state,
@@ -385,10 +385,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
pr_err("Missing tfo->release_cmd()\n");
return -EINVAL;
}
- if (!tfo->sess_get_index) {
- pr_err("Missing tfo->sess_get_index()\n");
- return -EINVAL;
- }
if (!tfo->write_pending) {
pr_err("Missing tfo->write_pending()\n");
return -EINVAL;
@@ -1264,7 +1264,6 @@ static ssize_t target_stat_iport_indx_show(struct config_item *item,
struct se_lun_acl *lacl = iport_to_lacl(item);
struct se_node_acl *nacl = lacl->se_lun_nacl;
struct se_session *se_sess;
- struct se_portal_group *tpg;
ssize_t ret;
spin_lock_irq(&nacl->nacl_sess_lock);
@@ -1274,10 +1273,8 @@ static ssize_t target_stat_iport_indx_show(struct config_item *item,
return -ENODEV;
}
- tpg = nacl->se_tpg;
/* scsiAttIntrPortIndex */
- ret = snprintf(page, PAGE_SIZE, "%u\n",
- tpg->se_tpg_tfo->sess_get_index(se_sess));
+ ret = snprintf(page, PAGE_SIZE, "%u\n", se_sess->sid);
spin_unlock_irq(&nacl->nacl_sess_lock);
return ret;
}
@@ -426,7 +426,6 @@ static u32 ft_tpg_get_inst_index(struct se_portal_group *se_tpg)
.check_stop_free = ft_check_stop_free,
.release_cmd = ft_release_cmd,
.close_session = ft_sess_close,
- .sess_get_index = ft_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = ft_write_pending,
.set_default_node_attributes = ft_set_default_node_attr,
@@ -325,13 +325,6 @@ void ft_sess_close(struct se_session *se_sess)
synchronize_rcu(); /* let transport deregister happen */
}
-u32 ft_sess_get_index(struct se_session *se_sess)
-{
- struct ft_sess *sess = se_sess->fabric_sess_ptr;
-
- return sess->port_id; /* XXX TBD probably not what is needed */
-}
-
u32 ft_sess_get_port_name(struct se_session *se_sess,
unsigned char *buf, u32 len)
{
@@ -1292,11 +1292,6 @@ static void usbg_release_cmd(struct se_cmd *se_cmd)
target_free_tag(se_sess, se_cmd);
}
-static u32 usbg_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static void usbg_set_default_node_attrs(struct se_node_acl *nacl)
{
}
@@ -1719,7 +1714,6 @@ static int usbg_check_stop_free(struct se_cmd *se_cmd)
.tpg_check_prod_mode_write_protect = usbg_check_false,
.tpg_get_inst_index = usbg_tpg_get_inst_index,
.release_cmd = usbg_release_cmd,
- .sess_get_index = usbg_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = usbg_send_write_request,
.set_default_node_attributes = usbg_set_default_node_attrs,
@@ -340,11 +340,6 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd)
target_free_tag(se_sess, se_cmd);
}
-static u32 vhost_scsi_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static int vhost_scsi_write_pending(struct se_cmd *se_cmd)
{
/* Go ahead and process the write immediately */
@@ -2291,7 +2286,6 @@ static void vhost_scsi_drop_tport(struct se_wwn *wwn)
.tpg_get_inst_index = vhost_scsi_tpg_get_inst_index,
.release_cmd = vhost_scsi_release_cmd,
.check_stop_free = vhost_scsi_check_stop_free,
- .sess_get_index = vhost_scsi_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = vhost_scsi_write_pending,
.set_default_node_attributes = vhost_scsi_set_default_node_attrs,
@@ -1392,11 +1392,6 @@ static void scsiback_release_cmd(struct se_cmd *se_cmd)
target_free_tag(se_cmd->se_sess, se_cmd);
}
-static u32 scsiback_sess_get_index(struct se_session *se_sess)
-{
- return 0;
-}
-
static int scsiback_write_pending(struct se_cmd *se_cmd)
{
/* Go ahead and process the write immediately */
@@ -1811,7 +1806,6 @@ static int scsiback_check_false(struct se_portal_group *se_tpg)
.tpg_get_inst_index = scsiback_tpg_get_inst_index,
.check_stop_free = scsiback_check_stop_free,
.release_cmd = scsiback_release_cmd,
- .sess_get_index = scsiback_sess_get_index,
.sess_get_initiator_sid = NULL,
.write_pending = scsiback_write_pending,
.set_default_node_attributes = scsiback_set_default_node_attrs,
@@ -66,7 +66,6 @@ struct target_core_fabric_ops {
int (*check_stop_free)(struct se_cmd *);
void (*release_cmd)(struct se_cmd *);
void (*close_session)(struct se_session *);
- u32 (*sess_get_index)(struct se_session *);
/*
* Used only for SCSI fabrics that contain multi-value TransportIDs
* (like iSCSI). All other SCSI fabrics should set this to NULL.