Re: [PATCH 05/15] target: remove sess_get_index

2018-07-19 Thread Christoph Hellwig
On Sun, Jul 15, 2018 at 06:16:21PM -0500, Mike Christie wrote:
> sess_get_index is meaninless for most drivers. For iscsi, it
> is the same as the se_session->sid now and for fcoe it was just
> the port id which would not work if multiple initiators
> connected to the same target port. So just use the se_session sid
> for all drivers and remove sess_get_index callout.

Use up all your space again (not going to complain for any further
patches).

Modulo that and the type that Bart found:

Reviewed-by: Christoph Hellwig 


Re: [PATCH 05/15] target: remove sess_get_index

2018-07-18 Thread Bart Van Assche
On Sun, 2018-07-15 at 18:16 -0500, Mike Christie wrote:
> sess_get_index is meaninless for most drivers. For iscsi, it
^^
meaningless?
> is the same as the se_session->sid now and for fcoe it was just
> the port id which would not work if multiple initiators
> connected to the same target port. So just use the se_session sid
> for all drivers and remove sess_get_index callout.

Anyway:

Reviewed-by: Bart Van Assche 


[PATCH 05/15] target: remove sess_get_index

2018-07-15 Thread Mike Christie
sess_get_index is meaninless for most drivers. For iscsi, it
is the same as the se_session->sid now and for fcoe it was just
the port id which would not work if multiple initiators
connected to the same target port. So just use the se_session sid
for all drivers and remove sess_get_index callout.

Signed-off-by: Mike Christie 
---
 Documentation/target/tcm_mod_builder.py  |  8 
 drivers/infiniband/ulp/srpt/ib_srpt.c| 15 ---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c |  6 --
 drivers/scsi/qla2xxx/tcm_qla2xxx.c   |  7 ---
 drivers/target/iscsi/iscsi_target_configfs.c |  6 --
 drivers/target/loopback/tcm_loop.c   |  6 --
 drivers/target/sbp/sbp_target.c  |  6 --
 drivers/target/target_core_configfs.c|  4 
 drivers/target/target_core_stat.c|  3 +--
 drivers/target/tcm_fc/tcm_fc.h   |  1 -
 drivers/target/tcm_fc/tfc_conf.c |  1 -
 drivers/target/tcm_fc/tfc_sess.c |  7 ---
 drivers/usb/gadget/function/f_tcm.c  |  6 --
 drivers/vhost/scsi.c |  6 --
 drivers/xen/xen-scsiback.c   |  6 --
 include/target/target_core_fabric.h  |  1 -
 16 files changed, 1 insertion(+), 88 deletions(-)

diff --git a/Documentation/target/tcm_mod_builder.py 
b/Documentation/target/tcm_mod_builder.py
index 94bf694..1befc88 100755
--- a/Documentation/target/tcm_mod_builder.py
+++ b/Documentation/target/tcm_mod_builder.py
@@ -294,7 +294,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, 
fabric_mod_name):
buf += ".tpg_check_prod_mode_write_protect = " + 
fabric_mod_name + "_check_false,\n"
buf += ".tpg_get_inst_index = " + fabric_mod_name + 
"_tpg_get_inst_index,\n"
buf += ".release_cmd= " + fabric_mod_name + 
"_release_cmd,\n"
-   buf += ".sess_get_index = " + fabric_mod_name + 
"_sess_get_index,\n"
buf += ".sess_get_initiator_sid = NULL,\n"
buf += ".write_pending  = " + fabric_mod_name + 
"_write_pending,\n"
buf += ".write_pending_status   = " + fabric_mod_name + 
"_write_pending_status,\n"
@@ -465,13 +464,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, 
fabric_mod_dir_var, fabric_mod_name):
buf += "}\n\n"
bufi += "void " + fabric_mod_name + 
"_release_cmd(struct se_cmd *);\n"
 
-   if re.search('sess_get_index\)\(', fo):
-   buf += "u32 " + fabric_mod_name + 
"_sess_get_index(struct se_session *se_sess)\n"
-   buf += "{\n"
-   buf += "return 0;\n"
-   buf += "}\n\n"
-   bufi += "u32 " + fabric_mod_name + 
"_sess_get_index(struct se_session *);\n"
-
if re.search('write_pending\)\(', fo):
buf += "int " + fabric_mod_name + 
"_write_pending(struct se_cmd *se_cmd)\n"
buf += "{\n"
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c 
b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 07b3e1c..73fee6a 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3198,20 +3198,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)
 {
 }
@@ -3676,7 +3662,6 @@ static const struct target_core_fabric_ops srpt_template 
= {
.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,
.write_pending_status   = srpt_write_pending_status,
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index fdda04e..c04e4bd 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -3757,11 +3757,6 @@ static void ibmvscsis_release_cmd(struct se_cmd *se_cmd)
spin_unlock_bh(>intr_lock);
 }
 
-static u32 ibmvscsis_sess_get_index(struct se_session *se_sess)
-{
-   return 0;
-}
-