]> git.openpandora.org Git - pandora-kernel.git/commitdiff
target: Drop unnecessary core_tpg_register TFO parameter
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 21 May 2015 04:48:03 +0000 (21:48 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 16 Jun 2015 06:23:22 +0000 (23:23 -0700)
This patch drops unnecessary target_core_fabric_ops parameter usage
for core_tpg_register() during fabric driver TFO->fabric_make_tpg()
se_portal_group creation callback execution.

Instead, use the existing se_wwn->wwn_tf->tf_ops pointer to ensure
fabric driver is really using the same TFO provided at module_init
time.

Also go ahead and drop the forward TFO declarations tree-wide, and
handling the special case for iscsi-target discovery TPG.

Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
12 files changed:
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/iscsi/iscsi_target_tpg.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_tpg.c
drivers/target/tcm_fc/tfc_conf.c
drivers/usb/gadget/legacy/tcm_usb_gadget.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c
include/target/target_core_fabric.h

index dbad5c67a294def9204d3a190eb3d3882880e995..cea207e8b5d2a5d76346b07d906d2ce98e1f4bee 100644 (file)
@@ -92,7 +92,6 @@ MODULE_PARM_DESC(srpt_service_guid,
                 " instead of using the node_guid of the first HCA.");
 
 static struct ib_client srpt_client;
-static const struct target_core_fabric_ops srpt_template;
 static void srpt_release_channel(struct srpt_rdma_ch *ch);
 static int srpt_queue_status(struct se_cmd *cmd);
 
@@ -3733,8 +3732,7 @@ static struct se_portal_group *srpt_make_tpg(struct se_wwn *wwn,
        int res;
 
        /* Initialize sport->port_wwn and sport->port_tpg_1 */
-       res = core_tpg_register(&srpt_template, &sport->port_wwn,
-                       &sport->port_tpg_1, SCSI_PROTOCOL_SRP);
+       res = core_tpg_register(&sport->port_wwn, &sport->port_tpg_1, SCSI_PROTOCOL_SRP);
        if (res)
                return ERR_PTR(res);
 
index cb53144c72d0998cc5a5d0c9a99ae5670392ceff..e14a7fd7d8103d65cb7693ee8b48b0c01c92db9e 100644 (file)
@@ -52,9 +52,6 @@
 static struct workqueue_struct *tcm_qla2xxx_free_wq;
 static struct workqueue_struct *tcm_qla2xxx_cmd_wq;
 
-static const struct target_core_fabric_ops tcm_qla2xxx_ops;
-static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops;
-
 /*
  * Parse WWN.
  * If strict, we require lower-case hex and colon separators to be sure
@@ -1004,8 +1001,7 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg(
        tpg->tpg_attrib.cache_dynamic_acls = 1;
        tpg->tpg_attrib.demo_mode_login_only = 1;
 
-       ret = core_tpg_register(&tcm_qla2xxx_ops, wwn, &tpg->se_tpg,
-                               SCSI_PROTOCOL_FCP);
+       ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_FCP);
        if (ret < 0) {
                kfree(tpg);
                return NULL;
@@ -1124,8 +1120,7 @@ static struct se_portal_group *tcm_qla2xxx_npiv_make_tpg(
        tpg->tpg_attrib.cache_dynamic_acls = 1;
        tpg->tpg_attrib.demo_mode_login_only = 1;
 
-       ret = core_tpg_register(&tcm_qla2xxx_npiv_ops, wwn, &tpg->se_tpg,
-                               SCSI_PROTOCOL_FCP);
+       ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_FCP);
        if (ret < 0) {
                kfree(tpg);
                return NULL;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge