scsi: target: Remove second argument from fabric_make_tpg()
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 22 Jun 2018 21:53:02 +0000 (14:53 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 2 Jul 2018 20:44:32 +0000 (16:44 -0400)
Since most target drivers do not use the second fabric_make_tpg() argument
("group") and since it is trivial to derive the group pointer from the wwn
pointer, do not pass the group pointer to fabric_make_tpg().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
12 files changed:
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_fabric_configfs.c
drivers/target/tcm_fc/tfc_conf.c
drivers/usb/gadget/function/f_tcm.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c
include/target/target_core_fabric.h

index 3081c629a7f79730e319504fd72fa4e92f66debf..07b3e1c583bdb817b535ccfc431b40d51d0553a6 100644 (file)
@@ -3597,11 +3597,9 @@ static struct configfs_attribute *srpt_tpg_attrs[] = {
 /**
  * srpt_make_tpg - configfs callback invoked for mkdir /sys/kernel/config/target/$driver/$port/$tpg
  * @wwn: Corresponds to $driver/$port.
- * @group: Not used.
  * @name: $tpg.
  */
 static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn,
-                                            struct config_group *group,
                                             const char *name)
 {
        struct srpt_port *sport = wwn->priv;
index c3a76af9f5fa9ba2e9b71632ca7514f81bf6cc29..fdda04e5cf94c17c7d3f3ffc246a68d0bfd2dc7e 100644 (file)
@@ -3928,7 +3928,6 @@ static void ibmvscsis_drop_tport(struct se_wwn *wwn)
 }
 
 static struct se_portal_group *ibmvscsis_make_tpg(struct se_wwn *wwn,
-                                                 struct config_group *group,
                                                  const char *name)
 {
        struct ibmvscsis_tport *tport =
index 7732e9336d43aa6c11e87c9cd94ec13e810101ba..cfb5d6067f9f9fec12995f8a037852a8f15a05b8 100644 (file)
@@ -1049,10 +1049,8 @@ static struct configfs_attribute *tcm_qla2xxx_tpg_attrs[] = {
        NULL,
 };
 
-static struct se_portal_group *tcm_qla2xxx_make_tpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *tcm_qla2xxx_make_tpg(struct se_wwn *wwn,
+                                                   const char *name)
 {
        struct tcm_qla2xxx_lport *lport = container_of(wwn,
                        struct tcm_qla2xxx_lport, lport_wwn);
@@ -1171,10 +1169,8 @@ static struct configfs_attribute *tcm_qla2xxx_npiv_tpg_attrs[] = {
         NULL,
 };
 
-static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(struct se_wwn *wwn,
+                                                        const char *name)
 {
        struct tcm_qla2xxx_lport *lport = container_of(wwn,
                        struct tcm_qla2xxx_lport, lport_wwn);
index 0bc346b2c27cf94b00208eed0f218ac21b755307..1fcd9bc7189dd15164c124afc1a3ceda3b5ab4cd 100644 (file)
@@ -1090,10 +1090,8 @@ static struct configfs_attribute *lio_target_tpg_attrs[] = {
 
 /* Start items for lio_target_tiqn_cit */
 
-static struct se_portal_group *lio_target_tiqn_addtpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *lio_target_tiqn_addtpg(struct se_wwn *wwn,
+                                                     const char *name)
 {
        struct iscsi_portal_group *tpg;
        struct iscsi_tiqn *tiqn;
index 60d5b918c4ac028573a53015db54480f13c34e6a..4c8a97711291777d6b671bb293a97aad87372f92 100644 (file)
@@ -983,10 +983,8 @@ static struct configfs_attribute *tcm_loop_tpg_attrs[] = {
 
 /* Start items for tcm_loop_naa_cit */
 
-static struct se_portal_group *tcm_loop_make_naa_tpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *tcm_loop_make_naa_tpg(struct se_wwn *wwn,
+                                                    const char *name)
 {
        struct tcm_loop_hba *tl_hba = container_of(wwn,
                        struct tcm_loop_hba, tl_hba_wwn);
index 42b21f2ac8b0dc6ff36c22565fd67a6dbba25fd5..b61b79ac98ff77e8fb9c8bb4e9a4ed616122df54 100644 (file)
@@ -2006,10 +2006,8 @@ static void sbp_pre_unlink_lun(
                pr_err("unlink LUN: failed to update unit directory\n");
 }
 
-static struct se_portal_group *sbp_make_tpg(
-               struct se_wwn *wwn,
-               struct config_group *group,
-               const char *name)
+static struct se_portal_group *sbp_make_tpg(struct se_wwn *wwn,
+                                           const char *name)
 {
        struct sbp_tport *tport =
                container_of(wwn, struct sbp_tport, tport_wwn);
index e1416b007aa43e0dcbd40d3b4d5e720c42e355c4..1fa436e865f94b4be23cc949afd0d7f1bc542412 100644 (file)
@@ -841,7 +841,7 @@ static struct config_group *target_fabric_make_tpg(
                return ERR_PTR(-ENOSYS);
        }
 
-       se_tpg = tf->tf_ops->fabric_make_tpg(wwn, group, name);
+       se_tpg = tf->tf_ops->fabric_make_tpg(wwn, name);
        if (!se_tpg || IS_ERR(se_tpg))
                return ERR_PTR(-EINVAL);
 
index 42ee91123dcaed297ffc8f9a3766adfb7dda39c7..e55c4d537592a6707db2bdb81c1f61a8ba59382b 100644 (file)
@@ -223,10 +223,7 @@ static int ft_init_nodeacl(struct se_node_acl *nacl, const char *name)
 /*
  * local_port port_group (tpg) ops.
  */
-static struct se_portal_group *ft_add_tpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *ft_add_tpg(struct se_wwn *wwn, const char *name)
 {
        struct ft_lport_wwn *ft_wwn;
        struct ft_tpg *tpg;
index 5003e857dce7436567350c930378a85717877f2b..4f183176b0b4eeaafa1c9e12dce9e2225c77d0c3 100644 (file)
@@ -1344,10 +1344,8 @@ static int usbg_init_nodeacl(struct se_node_acl *se_nacl, const char *name)
        return 0;
 }
 
-static struct se_portal_group *usbg_make_tpg(
-       struct se_wwn *wwn,
-       struct config_group *group,
-       const char *name)
+static struct se_portal_group *usbg_make_tpg(struct se_wwn *wwn,
+                                            const char *name)
 {
        struct usbg_tport *tport = container_of(wwn, struct usbg_tport,
                        tport_wwn);
@@ -1380,7 +1378,7 @@ static struct se_portal_group *usbg_make_tpg(
                        goto unlock_dep;
        } else {
                ret = configfs_depend_item_unlocked(
-                       group->cg_subsys,
+                       wwn->wwn_group.cg_subsys,
                        &opts->func_inst.group.cg_item);
                if (ret)
                        goto unlock_dep;
index ebaf831285ead00f033202d117a8579b153fe7ed..c84a6edd4c2594ee0e41c4998dff5fd80d3de9e0 100644 (file)
@@ -1912,9 +1912,7 @@ static struct configfs_attribute *vhost_scsi_tpg_attrs[] = {
 };
 
 static struct se_portal_group *
-vhost_scsi_make_tpg(struct se_wwn *wwn,
-                  struct config_group *group,
-                  const char *name)
+vhost_scsi_make_tpg(struct se_wwn *wwn, const char *name)
 {
        struct vhost_scsi_tport *tport = container_of(wwn,
                        struct vhost_scsi_tport, tport_wwn);
index 764dd9aa0131722539471fb519497d6bccd47ca8..fd77ccfc7d6ea8397a02e77f5cb34f58d9b55674 100644 (file)
@@ -1732,9 +1732,7 @@ static void scsiback_port_unlink(struct se_portal_group *se_tpg,
 }
 
 static struct se_portal_group *
-scsiback_make_tpg(struct se_wwn *wwn,
-                  struct config_group *group,
-                  const char *name)
+scsiback_make_tpg(struct se_wwn *wwn, const char *name)
 {
        struct scsiback_tport *tport = container_of(wwn,
                        struct scsiback_tport, tport_wwn);
index 84a681b6e5cac754b15dc8726e4c770a3fedff11..f61aa716cfe186c003cdca2399b88866a8bbd011 100644 (file)
@@ -79,7 +79,7 @@ struct target_core_fabric_ops {
        void (*fabric_drop_wwn)(struct se_wwn *);
        void (*add_wwn_groups)(struct se_wwn *);
        struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *,
-                               struct config_group *, const char *);
+                                                  const char *);
        void (*fabric_drop_tpg)(struct se_portal_group *);
        int (*fabric_post_link)(struct se_portal_group *,
                                struct se_lun *);