[PATCH v4 03/11] cxgbi: prepare to move module reference from scsi_host_template to Scsi_Host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In preparation for moving owner module reference field from struct
scsi_host_template to struct Scsi_Host, this converts cxgbi_hbas_add() into
macro so that LLDDs can pass THIS_MODULE to __iscsi_host_alloc() through
it instead of scsi_host_template->module.

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Cc: Mike Christie <michaelc@xxxxxxxxxxx>
Cc: Karen Xie <kxie@xxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: "James E.J. Bottomley" <JBottomley@xxxxxxxxxxxxx>
Cc: open-iscsi@xxxxxxxxxxxxxxxx
Cc: linux-scsi@xxxxxxxxxxxxxxx
---
 drivers/scsi/cxgbi/libcxgbi.c | 8 ++++----
 drivers/scsi/cxgbi/libcxgbi.h | 6 ++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index eb58afc..f090d63 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -330,9 +330,9 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
 }
 EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
 
-int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
+int __cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
 		unsigned int max_id, struct scsi_host_template *sht,
-		struct scsi_transport_template *stt)
+		struct scsi_transport_template *stt, struct module *owner)
 {
 	struct cxgbi_hba *chba;
 	struct Scsi_Host *shost;
@@ -341,7 +341,7 @@ int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
 	log_debug(1 << CXGBI_DBG_DEV, "cdev 0x%p, p#%u.\n", cdev, cdev->nports);
 
 	for (i = 0; i < cdev->nports; i++) {
-		shost = iscsi_host_alloc(sht, sizeof(*chba), 1);
+		shost = __iscsi_host_alloc(sht, sizeof(*chba), 1, owner);
 		if (!shost) {
 			pr_info("0x%p, p%d, %s, host alloc failed.\n",
 				cdev, i, cdev->ports[i]->name);
@@ -383,7 +383,7 @@ err_out:
 	cxgbi_hbas_remove(cdev);
 	return err;
 }
-EXPORT_SYMBOL_GPL(cxgbi_hbas_add);
+EXPORT_SYMBOL_GPL(__cxgbi_hbas_add);
 
 /*
  * iSCSI offload
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index aba1af7..26c8bf7 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -707,9 +707,11 @@ struct cxgbi_device *cxgbi_device_find_by_lldev(void *);
 struct cxgbi_device *cxgbi_device_find_by_netdev(struct net_device *, int *);
 struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *,
 						     int *);
-int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
+int __cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
 			struct scsi_host_template *,
-			struct scsi_transport_template *);
+			struct scsi_transport_template *, struct module *);
+#define cxgbi_hbas_add(cdev, max_lun, max_id, sht, stt) \
+	__cxgbi_hbas_add(cdev, max_lun, max_id, sht, stt, THIS_MODULE)
 void cxgbi_hbas_remove(struct cxgbi_device *);
 
 int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux