Re: [PATCH 07/15] target: rename target_alloc_session

2018-07-19 Thread Christoph Hellwig
On Sun, Jul 15, 2018 at 06:16:23PM -0500, Mike Christie wrote:
> Rename target_alloc_session to target_setup_session to avoid
> confusion with the other transport session allocation
> function that only allocates the session and because
> the target_alloc_session does so more. It allocates the
> session, sets up the nacl and egisters the session.
> 
> The next patch will then add a remove function to match the
> setup in this one, so it should make sense for all drivers,
> except iscsi, to just call those 2 functions to setup and remove
> a session.

Ok.

> iscsi will continue to be the odd driver.

Wish we could sort that out eventually..

Otherwise looks fine:

Reviewed-by: Christoph Hellwig 


Re: [PATCH 07/15] target: rename target_alloc_session

2018-07-18 Thread Bart Van Assche
On Sun, 2018-07-15 at 18:16 -0500, Mike Christie wrote:
> Rename target_alloc_session to target_setup_session to avoid
> confusion with the other transport session allocation
> function that only allocates the session and because
> the target_alloc_session does so more. It allocates the
  ^
  much?
> session, sets up the nacl and egisters the session.
> 
> The next patch will then add a remove function to match the
> setup in this one, so it should make sense for all drivers,
> except iscsi, to just call those 2 functions to setup and remove
> a session.

Anyway:

Reviewed-by: Bart Van Assche 


[PATCH 07/15] target: rename target_alloc_session

2018-07-15 Thread Mike Christie
Rename target_alloc_session to target_setup_session to avoid
confusion with the other transport session allocation
function that only allocates the session and because
the target_alloc_session does so more. It allocates the
session, sets up the nacl and egisters the session.

The next patch will then add a remove function to match the
setup in this one, so it should make sense for all drivers,
except iscsi, to just call those 2 functions to setup and remove
a session.

iscsi will continue to be the odd driver.

Signed-off-by: Mike Christie 
---
 drivers/infiniband/ulp/srpt/ib_srpt.c| 6 +++---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
 drivers/scsi/qla2xxx/tcm_qla2xxx.c   | 2 +-
 drivers/target/loopback/tcm_loop.c   | 2 +-
 drivers/target/sbp/sbp_target.c  | 2 +-
 drivers/target/target_core_transport.c   | 4 ++--
 drivers/target/tcm_fc/tfc_sess.c | 2 +-
 drivers/usb/gadget/function/f_tcm.c  | 2 +-
 drivers/vhost/scsi.c | 2 +-
 drivers/xen/xen-scsiback.c   | 2 +-
 include/target/target_core_fabric.h  | 2 +-
 11 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c 
b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 73fee6a..496ee6b 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2221,16 +2221,16 @@ static int srpt_cm_req_recv(struct srpt_device *const 
sdev,
pr_debug("registering session %s\n", ch->sess_name);
 
if (sport->port_guid_tpg.se_tpg_wwn)
-   ch->sess = target_alloc_session(>port_guid_tpg, 0, 0,
+   ch->sess = target_setup_session(>port_guid_tpg, 0, 0,
TARGET_PROT_NORMAL,
ch->sess_name, ch, NULL);
if (sport->port_gid_tpg.se_tpg_wwn && IS_ERR_OR_NULL(ch->sess))
-   ch->sess = target_alloc_session(>port_gid_tpg, 0, 0,
+   ch->sess = target_setup_session(>port_gid_tpg, 0, 0,
TARGET_PROT_NORMAL, i_port_id, ch,
NULL);
/* Retry without leading "0x" */
if (sport->port_gid_tpg.se_tpg_wwn && IS_ERR_OR_NULL(ch->sess))
-   ch->sess = target_alloc_session(>port_gid_tpg, 0, 0,
+   ch->sess = target_setup_session(>port_gid_tpg, 0, 0,
TARGET_PROT_NORMAL,
i_port_id + 2, ch, NULL);
if (IS_ERR_OR_NULL(ch->sess)) {
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index c04e4bd..7e2d2c0 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -2233,7 +2233,7 @@ static int ibmvscsis_make_nexus(struct ibmvscsis_tport 
*tport)
return -ENOMEM;
}
 
-   nexus->se_sess = target_alloc_session(>se_tpg, 0, 0,
+   nexus->se_sess = target_setup_session(>se_tpg, 0, 0,
  TARGET_PROT_NORMAL, name, nexus,
  NULL);
if (IS_ERR(nexus->se_sess)) {
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c 
b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 2516216..c0e1921 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -1534,7 +1534,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(
 * Locate our struct se_node_acl either from an explict NodeACL created
 * via ConfigFS, or via running in TPG demo mode.
 */
-   se_sess = target_alloc_session(>se_tpg, num_tags,
+   se_sess = target_setup_session(>se_tpg, num_tags,
   sizeof(struct qla_tgt_cmd),
   TARGET_PROT_ALL, port_name,
   qlat_sess, tcm_qla2xxx_session_cb);
diff --git a/drivers/target/loopback/tcm_loop.c 
b/drivers/target/loopback/tcm_loop.c
index c3b39b6..3bb2236 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -760,7 +760,7 @@ static int tcm_loop_make_nexus(
if (!tl_nexus)
return -ENOMEM;
 
-   tl_nexus->se_sess = target_alloc_session(_tpg->tl_se_tpg, 0, 0,
+   tl_nexus->se_sess = target_setup_session(_tpg->tl_se_tpg, 0, 0,
TARGET_PROT_DIN_PASS | 
TARGET_PROT_DOUT_PASS,
name, tl_nexus, tcm_loop_alloc_sess_cb);
if (IS_ERR(tl_nexus->se_sess)) {
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index 33b3b4b..14244bf 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -209,7 +209,7 @@ static struct sbp_session *sbp_session_create(
INIT_DELAYED_WORK(>maint_work, session_maintenance_work);
sess->guid = guid;
 
-