]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
scsi: target: rename target_alloc_session
authorMike Christie <mchristi@redhat.com>
Thu, 2 Aug 2018 17:12:23 +0000 (12:12 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 2 Aug 2018 19:29:31 +0000 (15:29 -0400)
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 much more. It
allocates the session, sets up the nacl and registers 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 <mchristi@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Chris Boot <bootc@bootc.net>
Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Cc: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Cc: <qla2xxx-upstream@qlogic.com>
Cc: Johannes Thumshirn <jth@kernel.org>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_transport.c
drivers/target/tcm_fc/tfc_sess.c
drivers/usb/gadget/function/f_tcm.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c
include/target/target_core_fabric.h

index 07b3e1c583bdb817b535ccfc431b40d51d0553a6..21435a73771a925714fc99abc2e2f7afd4ffba4a 100644 (file)
@@ -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(&sport->port_guid_tpg, 0, 0,
+               ch->sess = target_setup_session(&sport->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(&sport->port_gid_tpg, 0, 0,
+               ch->sess = target_setup_session(&sport->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(&sport->port_gid_tpg, 0, 0,
+               ch->sess = target_setup_session(&sport->port_gid_tpg, 0, 0,
                                                TARGET_PROT_NORMAL,
                                                i_port_id + 2, ch, NULL);
        if (IS_ERR_OR_NULL(ch->sess)) {
index fdda04e5cf94c17c7d3f3ffc246a68d0bfd2dc7e..1bdf9379c4ce0842994c272c349984b46605ea21 100644 (file)
@@ -2233,7 +2233,7 @@ static int ibmvscsis_make_nexus(struct ibmvscsis_tport *tport)
                return -ENOMEM;
        }
 
-       nexus->se_sess = target_alloc_session(&tport->se_tpg, 0, 0,
+       nexus->se_sess = target_setup_session(&tport->se_tpg, 0, 0,
                                              TARGET_PROT_NORMAL, name, nexus,
                                              NULL);
        if (IS_ERR(nexus->se_sess)) {
index cfb5d6067f9f9fec12995f8a037852a8f15a05b8..b9ce4e7e1c3e478fe751e24b08d990855a8f191a 100644 (file)
@@ -1539,7 +1539,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(&tpg->se_tpg, num_tags,
+       se_sess = target_setup_session(&tpg->se_tpg, num_tags,
                                       sizeof(struct qla_tgt_cmd),
                                       TARGET_PROT_ALL, port_name,
                                       qlat_sess, tcm_qla2xxx_session_cb);
index b2e7ff50ff61c879558029366abd21b633d37864..54b5b94dad375bd4841636ab131087a221a6dbe6 100644 (file)
@@ -765,7 +765,7 @@ static int tcm_loop_make_nexus(
        if (!tl_nexus)
                return -ENOMEM;
 
-       tl_nexus->se_sess = target_alloc_session(&tl_tpg->tl_se_tpg, 0, 0,
+       tl_nexus->se_sess = target_setup_session(&tl_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)) {
index b61b79ac98ff77e8fb9c8bb4e9a4ed616122df54..c4369b52a3fb55c7b4c36ed38ba51e499c0f9299 100644 (file)
@@ -209,7 +209,7 @@ static struct sbp_session *sbp_session_create(
        INIT_DELAYED_WORK(&sess->maint_work, session_maintenance_work);
        sess->guid = guid;
 
-       sess->se_sess = target_alloc_session(&tpg->se_tpg, 128,
+       sess->se_sess = target_setup_session(&tpg->se_tpg, 128,
                                             sizeof(struct sbp_target_request),
                                             TARGET_PROT_NORMAL, guid_str,
                                             sess, NULL);
index 8044b8115dbfe87e5fbafe991e4dbd0220ca6a2d..57fadec2d1aee7bdfa3453bc5a0bd3cc9fc8d8df 100644 (file)
@@ -416,7 +416,7 @@ void transport_register_session(
 EXPORT_SYMBOL(transport_register_session);
 
 struct se_session *
-target_alloc_session(struct se_portal_group *tpg,
+target_setup_session(struct se_portal_group *tpg,
                     unsigned int tag_num, unsigned int tag_size,
                     enum target_prot_op prot_op,
                     const char *initiatorname, void *private,
@@ -458,7 +458,7 @@ target_alloc_session(struct se_portal_group *tpg,
        transport_register_session(tpg, sess->se_node_acl, sess, private);
        return sess;
 }
-EXPORT_SYMBOL(target_alloc_session);
+EXPORT_SYMBOL(target_setup_session);
 
 ssize_t target_show_dynamic_sessions(struct se_portal_group *se_tpg, char *page)
 {
index c91979c1463d95899f909bfe62b9f2d47eb2c1cc..efd7d5e5bfc40eb9dc5bc1bff8201f5ef04254b5 100644 (file)
@@ -239,7 +239,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id,
        sess->tport = tport;
        sess->port_id = port_id;
 
-       sess->se_sess = target_alloc_session(se_tpg, TCM_FC_DEFAULT_TAGS,
+       sess->se_sess = target_setup_session(se_tpg, TCM_FC_DEFAULT_TAGS,
                                             sizeof(struct ft_cmd),
                                             TARGET_PROT_NORMAL, &initiatorname[0],
                                             sess, ft_sess_alloc_cb);
index 4f183176b0b4eeaafa1c9e12dce9e2225c77d0c3..ba7c5f68d38abb5988e022070e7aae99ca5e9701 100644 (file)
@@ -1592,7 +1592,7 @@ static int tcm_usbg_make_nexus(struct usbg_tpg *tpg, char *name)
                goto out_unlock;
        }
 
-       tv_nexus->tvn_se_sess = target_alloc_session(&tpg->se_tpg,
+       tv_nexus->tvn_se_sess = target_setup_session(&tpg->se_tpg,
                                                     USB_G_DEFAULT_SESSION_TAGS,
                                                     sizeof(struct usbg_cmd),
                                                     TARGET_PROT_NORMAL, name,
index c84a6edd4c2594ee0e41c4998dff5fd80d3de9e0..e9368842c63fd2ce475f3699599a07c40f17736a 100644 (file)
@@ -1738,7 +1738,7 @@ static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg,
         * struct se_node_acl for the vhost_scsi struct se_portal_group with
         * the SCSI Initiator port name of the passed configfs group 'name'.
         */
-       tv_nexus->tvn_se_sess = target_alloc_session(&tpg->se_tpg,
+       tv_nexus->tvn_se_sess = target_setup_session(&tpg->se_tpg,
                                        VHOST_SCSI_DEFAULT_TAGS,
                                        sizeof(struct vhost_scsi_cmd),
                                        TARGET_PROT_DIN_PASS | TARGET_PROT_DOUT_PASS,
index fd77ccfc7d6ea8397a02e77f5cb34f58d9b55674..2ffc7ed944d8d8b1b51e2dd6e4a2f618843f1f02 100644 (file)
@@ -1521,7 +1521,7 @@ static int scsiback_make_nexus(struct scsiback_tpg *tpg,
                goto out_unlock;
        }
 
-       tv_nexus->tvn_se_sess = target_alloc_session(&tpg->se_tpg,
+       tv_nexus->tvn_se_sess = target_setup_session(&tpg->se_tpg,
                                                     VSCSI_DEFAULT_SESSION_TAGS,
                                                     sizeof(struct vscsibk_pend),
                                                     TARGET_PROT_NORMAL, name,
index d0d064212bfc76c66b77b6481ed47d09765845a9..fbcc9a4025b9d3643e0d3875ded63fb77cb558c5 100644 (file)
@@ -109,7 +109,7 @@ void target_unregister_template(const struct target_core_fabric_ops *fo);
 int target_depend_item(struct config_item *item);
 void target_undepend_item(struct config_item *item);
 
-struct se_session *target_alloc_session(struct se_portal_group *,
+struct se_session *target_setup_session(struct se_portal_group *,
                unsigned int, unsigned int, enum target_prot_op prot_op,
                const char *, void *,
                int (*callback)(struct se_portal_group *,