Skip to content

Commit 1abf635

Browse files
hreineckeChristoph Hellwig
authored and
Christoph Hellwig
committed
scsi: use 64-bit value for 'max_luns'
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Ewan Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent b4210b8 commit 1abf635

File tree

14 files changed

+30
-22
lines changed

14 files changed

+30
-22
lines changed

drivers/message/i2o/i2o_scsi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static int i2o_scsi_probe(struct device *dev)
287287
}
288288

289289
if (le64_to_cpu(lun) >= scsi_host->max_lun) {
290-
osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%d)",
290+
osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%llu)",
291291
le64_to_cpu(lun), scsi_host->max_lun);
292292
return -EFAULT;
293293
}

drivers/scsi/advansys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3345,7 +3345,7 @@ static void asc_prt_driver_conf(struct seq_file *m, struct Scsi_Host *shost)
33453345
shost->host_no);
33463346

33473347
seq_printf(m,
3348-
" host_busy %u, max_id %u, max_lun %u, max_channel %u\n",
3348+
" host_busy %u, max_id %u, max_lun %llu, max_channel %u\n",
33493349
shost->host_busy, shost->max_id,
33503350
shost->max_lun, shost->max_channel);
33513351

drivers/scsi/cxgbi/libcxgbi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
245245
}
246246
EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
247247

248-
int cxgbi_hbas_add(struct cxgbi_device *cdev, unsigned int max_lun,
248+
int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
249249
unsigned int max_id, struct scsi_host_template *sht,
250250
struct scsi_transport_template *stt)
251251
{

drivers/scsi/cxgbi/libcxgbi.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int);
692692
void cxgbi_device_unregister(struct cxgbi_device *);
693693
void cxgbi_device_unregister_all(unsigned int flag);
694694
struct cxgbi_device *cxgbi_device_find_by_lldev(void *);
695-
int cxgbi_hbas_add(struct cxgbi_device *, unsigned int, unsigned int,
695+
int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
696696
struct scsi_host_template *,
697697
struct scsi_transport_template *);
698698
void cxgbi_hbas_remove(struct cxgbi_device *);

drivers/scsi/dc395x.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4638,7 +4638,7 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
46384638
SPRINTF("irq_level 0x%04x, ", acb->irq_level);
46394639
SPRINTF(" SelTimeout %ims\n", (1638 * acb->sel_timeout) / 1000);
46404640

4641-
SPRINTF("MaxID %i, MaxLUN %i, ", host->max_id, host->max_lun);
4641+
SPRINTF("MaxID %i, MaxLUN %llu, ", host->max_id, host->max_lun);
46424642
SPRINTF("AdapterID %i\n", host->this_id);
46434643

46444644
SPRINTF("tag_max_num %i", acb->tag_max_num);

drivers/scsi/eata.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ static int port_detect(unsigned long port_base, unsigned int j,
13991399

14001400
if (shost->max_id > 8 || shost->max_lun > 8)
14011401
printk
1402-
("%s: wide SCSI support enabled, max_id %u, max_lun %u.\n",
1402+
("%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n",
14031403
ha->board_name, shost->max_id, shost->max_lun);
14041404

14051405
for (i = 0; i <= shost->max_channel; i++)

drivers/scsi/ibmvscsi/ibmvfc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
static unsigned int init_timeout = IBMVFC_INIT_TIMEOUT;
4848
static unsigned int default_timeout = IBMVFC_DEFAULT_TIMEOUT;
49-
static unsigned int max_lun = IBMVFC_MAX_LUN;
49+
static u64 max_lun = IBMVFC_MAX_LUN;
5050
static unsigned int max_targets = IBMVFC_MAX_TARGETS;
5151
static unsigned int max_requests = IBMVFC_MAX_REQUESTS_DEFAULT;
5252
static unsigned int disc_threads = IBMVFC_MAX_DISC_THREADS;
@@ -71,7 +71,7 @@ MODULE_PARM_DESC(default_timeout,
7171
module_param_named(max_requests, max_requests, uint, S_IRUGO);
7272
MODULE_PARM_DESC(max_requests, "Maximum requests for this adapter. "
7373
"[Default=" __stringify(IBMVFC_MAX_REQUESTS_DEFAULT) "]");
74-
module_param_named(max_lun, max_lun, uint, S_IRUGO);
74+
module_param_named(max_lun, max_lun, ullong, S_IRUGO);
7575
MODULE_PARM_DESC(max_lun, "Maximum allowed LUN. "
7676
"[Default=" __stringify(IBMVFC_MAX_LUN) "]");
7777
module_param_named(max_targets, max_targets, uint, S_IRUGO);

drivers/scsi/lpfc/lpfc_attr.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,14 @@ lpfc_vport_param_show(name)\
19981998
lpfc_vport_param_init(name, defval, minval, maxval)\
19991999
static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
20002000

2001+
#define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
2002+
static uint64_t lpfc_##name = defval;\
2003+
module_param(lpfc_##name, ullong, S_IRUGO);\
2004+
MODULE_PARM_DESC(lpfc_##name, desc);\
2005+
lpfc_vport_param_show(name)\
2006+
lpfc_vport_param_init(name, defval, minval, maxval)\
2007+
static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
2008+
20012009
#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
20022010
static uint lpfc_##name = defval;\
20032011
module_param(lpfc_##name, uint, S_IRUGO);\
@@ -4596,7 +4604,7 @@ LPFC_VPORT_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
45964604
# Value range is [0,65535]. Default value is 255.
45974605
# NOTE: The SCSI layer might probe all allowed LUN on some old targets.
45984606
*/
4599-
LPFC_VPORT_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
4607+
LPFC_VPORT_ULL_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN ID");
46004608

46014609
/*
46024610
# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.

drivers/scsi/megaraid.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ megaraid_info(struct Scsi_Host *host)
18601860
"LSI Logic MegaRAID %s %d commands %d targs %d chans %d luns",
18611861
adapter->fw_version, adapter->product_info.max_commands,
18621862
adapter->host->max_id, adapter->host->max_channel,
1863-
adapter->host->max_lun);
1863+
(u32)adapter->host->max_lun);
18641864
return buffer;
18651865
}
18661866

drivers/scsi/mpt3sas/mpt3sas_scsih.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ MODULE_PARM_DESC(missing_delay, " device missing delay , io missing delay");
112112

113113
/* scsi-mid layer global parmeter is max_report_luns, which is 511 */
114114
#define MPT3SAS_MAX_LUN (16895)
115-
static int max_lun = MPT3SAS_MAX_LUN;
116-
module_param(max_lun, int, 0);
115+
static u64 max_lun = MPT3SAS_MAX_LUN;
116+
module_param(max_lun, ullong, 0);
117117
MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
118118

119119

drivers/scsi/qla2xxx/qla_gbl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extern int ql2xenabledif;
113113
extern int ql2xenablehba_err_chk;
114114
extern int ql2xtargetreset;
115115
extern int ql2xdontresethba;
116-
extern unsigned int ql2xmaxlun;
116+
extern uint64_t ql2xmaxlun;
117117
extern int ql2xmdcapmask;
118118
extern int ql2xmdenable;
119119

drivers/scsi/qla2xxx/qla_os.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ MODULE_PARM_DESC(ql2xdontresethba,
202202
" 0 (Default) -- Reset on failure.\n"
203203
" 1 -- Do not reset on failure.\n");
204204

205-
uint ql2xmaxlun = MAX_LUNS;
206-
module_param(ql2xmaxlun, uint, S_IRUGO);
205+
uint64_t ql2xmaxlun = MAX_LUNS;
206+
module_param(ql2xmaxlun, ullong, S_IRUGO);
207207
MODULE_PARM_DESC(ql2xmaxlun,
208208
"Defines the maximum LU number to register with the SCSI "
209209
"midlayer. Default is 65535.");
@@ -2676,7 +2676,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
26762676
ql_dbg(ql_dbg_init, base_vha, 0x0033,
26772677
"max_id=%d this_id=%d "
26782678
"cmd_per_len=%d unique_id=%d max_cmd_len=%d max_channel=%d "
2679-
"max_lun=%d transportt=%p, vendor_id=%llu.\n", host->max_id,
2679+
"max_lun=%llu transportt=%p, vendor_id=%llu.\n", host->max_id,
26802680
host->this_id, host->cmd_per_lun, host->unique_id,
26812681
host->max_cmd_len, host->max_channel, host->max_lun,
26822682
host->transportt, sht->vendor_id);

drivers/scsi/scsi_scan.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ static const char *scsi_null_device_strs = "nullnullnullnull";
8181

8282
#define MAX_SCSI_LUNS 512
8383

84-
static unsigned int max_scsi_luns = MAX_SCSI_LUNS;
84+
static u64 max_scsi_luns = MAX_SCSI_LUNS;
8585

86-
module_param_named(max_luns, max_scsi_luns, uint, S_IRUGO|S_IWUSR);
86+
module_param_named(max_luns, max_scsi_luns, ullong, S_IRUGO|S_IWUSR);
8787
MODULE_PARM_DESC(max_luns,
88-
"last scsi LUN (should be between 1 and 2^32-1)");
88+
"last scsi LUN (should be between 1 and 2^64-1)");
8989

9090
#ifdef CONFIG_SCSI_SCAN_ASYNC
9191
#define SCSI_SCAN_TYPE_DEFAULT "async"

include/scsi/scsi_host.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,11 @@ struct Scsi_Host {
623623
* These three parameters can be used to allow for wide scsi,
624624
* and for host adapters that support multiple busses
625625
* The first two should be set to 1 more than the actual max id
626-
* or lun (i.e. 8 for normal systems).
626+
* or lun (e.g. 8 for SCSI parallel systems).
627627
*/
628-
unsigned int max_id;
629-
unsigned int max_lun;
630628
unsigned int max_channel;
629+
unsigned int max_id;
630+
u64 max_lun;
631631

632632
/*
633633
* This is a unique identifier that must be assigned so that we

0 commit comments

Comments
 (0)