scsi: use 64-bit value for 'max_luns'
authorHannes Reinecke <hare@suse.de>
Wed, 25 Jun 2014 13:27:38 +0000 (15:27 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jul 2014 20:07:38 +0000 (22:07 +0200)
Now that we're using 64-bit LUNs internally we need to increase
the size of max_luns to 64 bits, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
14 files changed:
drivers/message/i2o/i2o_scsi.c
drivers/scsi/advansys.c
drivers/scsi/cxgbi/libcxgbi.c
drivers/scsi/cxgbi/libcxgbi.h
drivers/scsi/dc395x.c
drivers/scsi/eata.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/megaraid.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi_scan.c
include/scsi/scsi_host.h

index e7de92c67cf693f04ef96135c73b819d175f527e..8152e9fa9d95c2a4334d6efe7d94469cd8d07033 100644 (file)
@@ -287,7 +287,7 @@ static int i2o_scsi_probe(struct device *dev)
        }
 
        if (le64_to_cpu(lun) >= scsi_host->max_lun) {
-               osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%d)",
+               osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%llu)",
                         le64_to_cpu(lun), scsi_host->max_lun);
                return -EFAULT;
        }
index d8145888e66a584d9c340f2c08bd38ad5eed94c7..e716d0aef19463ee01899b4041ec8e25ffb41697 100644 (file)
@@ -3345,7 +3345,7 @@ static void asc_prt_driver_conf(struct seq_file *m, struct Scsi_Host *shost)
                shost->host_no);
 
        seq_printf(m,
-                  " host_busy %u, max_id %u, max_lun %u, max_channel %u\n",
+                  " host_busy %u, max_id %u, max_lun %llu, max_channel %u\n",
                   shost->host_busy, shost->max_id,
                   shost->max_lun, shost->max_channel);
 
index b44c1cff3114bb9a6aa6467540a3755d722ef5b3..dc812069046c6b50b71a1935952cac1b8e90e97c 100644 (file)
@@ -245,7 +245,7 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
 }
 EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
 
-int cxgbi_hbas_add(struct cxgbi_device *cdev, unsigned int 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)
 {
index 8135f04671af3d679400a3d72396aebadd5dc96e..538d7a64e13887e25ff690b17ed27029663b2025 100644 (file)
@@ -692,7 +692,7 @@ struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int);
 void cxgbi_device_unregister(struct cxgbi_device *);
 void cxgbi_device_unregister_all(unsigned int flag);
 struct cxgbi_device *cxgbi_device_find_by_lldev(void *);
-int cxgbi_hbas_add(struct cxgbi_device *, unsigned int, unsigned int,
+int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
                        struct scsi_host_template *,
                        struct scsi_transport_template *);
 void cxgbi_hbas_remove(struct cxgbi_device *);
index dff461f2338e3ac8c733235f8a2af24d6ce525ba..0c6be0a17f53f2e2aeefc83d4a500d6aa5d17265 100644 (file)
@@ -4638,7 +4638,7 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
        SPRINTF("irq_level 0x%04x, ", acb->irq_level);
        SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
 
-       SPRINTF("MaxID %i, MaxLUN %i, ", host->max_id, host->max_lun);
+       SPRINTF("MaxID %i, MaxLUN %llu, ", host->max_id, host->max_lun);
        SPRINTF("AdapterID %i\n", host->this_id);
 
        SPRINTF("tag_max_num %i", acb->tag_max_num);
index 0f27ac19cf0164f5c0d62054bc1d6b2fd1f51aaa..03372cff38f39b3caef6ff47b36cd04c5bf79c6c 100644 (file)
@@ -1399,7 +1399,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
 
        if (shost->max_id > 8 || shost->max_lun > 8)
                printk
-                   ("%s: wide SCSI support enabled, max_id %u, max_lun %u.\n",
+                   ("%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n",
                     ha->board_name, shost->max_id, shost->max_lun);
 
        for (i = 0; i <= shost->max_channel; i++)
index 8dd47689d58430a1147a389c1eeed1eea1afae1d..6eb47b683569c1161551bf84444732126b8812ac 100644 (file)
@@ -46,7 +46,7 @@
 
 static unsigned int init_timeout = IBMVFC_INIT_TIMEOUT;
 static unsigned int default_timeout = IBMVFC_DEFAULT_TIMEOUT;
-static unsigned int max_lun = IBMVFC_MAX_LUN;
+static u64 max_lun = IBMVFC_MAX_LUN;
 static unsigned int max_targets = IBMVFC_MAX_TARGETS;
 static unsigned int max_requests = IBMVFC_MAX_REQUESTS_DEFAULT;
 static unsigned int disc_threads = IBMVFC_MAX_DISC_THREADS;
@@ -71,7 +71,7 @@ MODULE_PARM_DESC(default_timeout,
 module_param_named(max_requests, max_requests, uint, S_IRUGO);
 MODULE_PARM_DESC(max_requests, "Maximum requests for this adapter. "
                 "[Default=" __stringify(IBMVFC_MAX_REQUESTS_DEFAULT) "]");
-module_param_named(max_lun, max_lun, uint, S_IRUGO);
+module_param_named(max_lun, max_lun, ullong, S_IRUGO);
 MODULE_PARM_DESC(max_lun, "Maximum allowed LUN. "
                 "[Default=" __stringify(IBMVFC_MAX_LUN) "]");
 module_param_named(max_targets, max_targets, uint, S_IRUGO);
index 1d7a5c34ee8cdb333ac7fd0a243c9dfc5850b6f1..6eed9e76a166508e8c41d81c76a520057e673dd2 100644 (file)
@@ -1998,6 +1998,14 @@ lpfc_vport_param_show(name)\
 lpfc_vport_param_init(name, defval, minval, maxval)\
 static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
 
+#define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
+static uint64_t lpfc_##name = defval;\
+module_param(lpfc_##name, ullong, S_IRUGO);\
+MODULE_PARM_DESC(lpfc_##name, desc);\
+lpfc_vport_param_show(name)\
+lpfc_vport_param_init(name, defval, minval, maxval)\
+static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
+
 #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
 static uint lpfc_##name = defval;\
 module_param(lpfc_##name, uint, S_IRUGO);\
@@ -4596,7 +4604,7 @@ LPFC_VPORT_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
 # Value range is [0,65535]. Default value is 255.
 # NOTE: The SCSI layer might probe all allowed LUN on some old targets.
 */
-LPFC_VPORT_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
+LPFC_VPORT_ULL_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
 
 /*
 # lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.
index 6bb2b52646b466e59392d62c168de38efffac9f6..ac5d94cfd52f22cdfbbe162f8a8868a8d4d6fe20 100644 (file)
@@ -1860,7 +1860,7 @@ megaraid_info(struct Scsi_Host *host)
                 "LSI Logic MegaRAID %s %d commands %d targs %d chans %d luns",
                 adapter->fw_version, adapter->product_info.max_commands,
                 adapter->host->max_id, adapter->host->max_channel,
-                adapter->host->max_lun);
+                (u32)adapter->host->max_lun);
        return buffer;
 }
 
index 18e713db1d328f10c6bd56848ac565ff36f2a958..0274ac3c533b00c3f8d0a1a5c2884a07a9489053 100644 (file)
@@ -112,8 +112,8 @@ MODULE_PARM_DESC(missing_delay, " device missing delay , io missing delay");
 
 /* scsi-mid layer global parmeter is max_report_luns, which is 511 */
 #define MPT3SAS_MAX_LUN (16895)
-static int max_lun = MPT3SAS_MAX_LUN;
-module_param(max_lun, int, 0);
+static u64 max_lun = MPT3SAS_MAX_LUN;
+module_param(max_lun, ullong, 0);
 MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
 
 
index 9ef0781b12da64a4b09606f9a24c029ed6406ade..d646540db3ac2af977840eeef5987df326ee5cd2 100644 (file)
@@ -113,7 +113,7 @@ extern int ql2xenabledif;
 extern int ql2xenablehba_err_chk;
 extern int ql2xtargetreset;
 extern int ql2xdontresethba;
-extern unsigned int ql2xmaxlun;
+extern uint64_t ql2xmaxlun;
 extern int ql2xmdcapmask;
 extern int ql2xmdenable;
 
index b22c75305b444b1ccf46b093031061af16a7b5fa..be9698d920c2a2e7853c800c3ed9c3004a0ab90c 100644 (file)
@@ -202,8 +202,8 @@ MODULE_PARM_DESC(ql2xdontresethba,
                " 0 (Default) -- Reset on failure.\n"
                " 1 -- Do not reset on failure.\n");
 
-uint ql2xmaxlun = MAX_LUNS;
-module_param(ql2xmaxlun, uint, S_IRUGO);
+uint64_t ql2xmaxlun = MAX_LUNS;
+module_param(ql2xmaxlun, ullong, S_IRUGO);
 MODULE_PARM_DESC(ql2xmaxlun,
                "Defines the maximum LU number to register with the SCSI "
                "midlayer. Default is 65535.");
@@ -2676,7 +2676,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        ql_dbg(ql_dbg_init, base_vha, 0x0033,
            "max_id=%d this_id=%d "
            "cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d "
-           "max_lun=%d transportt=%p, vendor_id=%llu.\n", host->max_id,
+           "max_lun=%llu transportt=%p, vendor_id=%llu.\n", host->max_id,
            host->this_id, host->cmd_per_lun, host->unique_id,
            host->max_cmd_len, host->max_channel, host->max_lun,
            host->transportt, sht->vendor_id);
index 1a71547832f34cc5abb62fa042cef3e45407af31..fa57a046f025e7a02b51c9ce58e8201a8f87ac8d 100644 (file)
@@ -81,11 +81,11 @@ static const char *scsi_null_device_strs = "nullnullnullnull";
 
 #define MAX_SCSI_LUNS  512
 
-static unsigned int max_scsi_luns = MAX_SCSI_LUNS;
+static u64 max_scsi_luns = MAX_SCSI_LUNS;
 
-module_param_named(max_luns, max_scsi_luns, uint, S_IRUGO|S_IWUSR);
+module_param_named(max_luns, max_scsi_luns, ullong, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(max_luns,
-                "last scsi LUN (should be between 1 and 2^32-1)");
+                "last scsi LUN (should be between 1 and 2^64-1)");
 
 #ifdef CONFIG_SCSI_SCAN_ASYNC
 #define SCSI_SCAN_TYPE_DEFAULT "async"
index db7d8bd2f86f4ff4605ef0b70a4d72bc5a578ee4..abb695882fed362233800392312191a6730070c3 100644 (file)
@@ -623,11 +623,11 @@ struct Scsi_Host {
         * These three parameters can be used to allow for wide scsi,
         * and for host adapters that support multiple busses
         * The first two should be set to 1 more than the actual max id
-        * or lun (i.e. 8 for normal systems).
+        * or lun (e.g. 8 for SCSI parallel systems).
         */
-       unsigned int max_id;
-       unsigned int max_lun;
        unsigned int max_channel;
+       unsigned int max_id;
+       u64 max_lun;
 
        /*
         * This is a unique identifier that must be assigned so that we
This page took 0.046793 seconds and 5 git commands to generate.