diff options
author | Hannes Reinecke <hare@suse.de> | 2014-06-25 09:27:36 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-17 16:07:37 -0400 |
commit | 9cb78c16f5dadefd8dc5ba0ae5a2f26cd59419b3 (patch) | |
tree | 576b86c3ec56dd7176285ec2d27f27ca55f77bc3 /drivers/message | |
parent | 755f516bbb983915d6cbfb5aa592cc0a5a99fd00 (diff) |
scsi: use 64-bit LUNs
The SCSI standard defines 64-bit values for LUNs, and large arrays
employing large or hierarchical LUN numbers become more and more
common.
So update the linux SCSI stack to use 64-bit LUN numbers.
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>
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptbase.h | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptfc.c | 6 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 14 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.h | 4 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_scsi.c | 11 |
5 files changed, 18 insertions, 19 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 76c05bc24cb7..f37ea6fdc6ae 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -405,7 +405,7 @@ typedef struct _VirtTarget { | |||
405 | typedef struct _VirtDevice { | 405 | typedef struct _VirtDevice { |
406 | VirtTarget *vtarget; | 406 | VirtTarget *vtarget; |
407 | u8 configured_lun; | 407 | u8 configured_lun; |
408 | int lun; | 408 | u64 lun; |
409 | } VirtDevice; | 409 | } VirtDevice; |
410 | 410 | ||
411 | /* | 411 | /* |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 02a3eefd6931..bf2a2cef562b 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -204,7 +204,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
204 | || (loops > 0 && ioc->active == 0)) { | 204 | || (loops > 0 && ioc->active == 0)) { |
205 | spin_unlock_irqrestore(shost->host_lock, flags); | 205 | spin_unlock_irqrestore(shost->host_lock, flags); |
206 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 206 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
207 | "mptfc_block_error_handler.%d: %d:%d, port status is " | 207 | "mptfc_block_error_handler.%d: %d:%llu, port status is " |
208 | "%x, active flag %d, deferring %s recovery.\n", | 208 | "%x, active flag %d, deferring %s recovery.\n", |
209 | ioc->name, ioc->sh->host_no, | 209 | ioc->name, ioc->sh->host_no, |
210 | SCpnt->device->id, SCpnt->device->lun, | 210 | SCpnt->device->id, SCpnt->device->lun, |
@@ -218,7 +218,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
218 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata | 218 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata |
219 | || ioc->active == 0) { | 219 | || ioc->active == 0) { |
220 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 220 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
221 | "%s.%d: %d:%d, failing recovery, " | 221 | "%s.%d: %d:%llu, failing recovery, " |
222 | "port state %x, active %d, vdevice %p.\n", caller, | 222 | "port state %x, active %d, vdevice %p.\n", caller, |
223 | ioc->name, ioc->sh->host_no, | 223 | ioc->name, ioc->sh->host_no, |
224 | SCpnt->device->id, SCpnt->device->lun, ready, | 224 | SCpnt->device->id, SCpnt->device->lun, ready, |
@@ -226,7 +226,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
226 | return FAILED; | 226 | return FAILED; |
227 | } | 227 | } |
228 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 228 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
229 | "%s.%d: %d:%d, executing recovery.\n", caller, | 229 | "%s.%d: %d:%llu, executing recovery.\n", caller, |
230 | ioc->name, ioc->sh->host_no, | 230 | ioc->name, ioc->sh->host_no, |
231 | SCpnt->device->id, SCpnt->device->lun)); | 231 | SCpnt->device->id, SCpnt->device->lun)); |
232 | return (*func)(SCpnt); | 232 | return (*func)(SCpnt); |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 2a1c6f21af27..39e566803089 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -95,7 +95,7 @@ static void mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx); | |||
95 | static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); | 95 | static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); |
96 | 96 | ||
97 | int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, | 97 | int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, |
98 | int lun, int ctx2abort, ulong timeout); | 98 | u64 lun, int ctx2abort, ulong timeout); |
99 | 99 | ||
100 | int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | 100 | int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
101 | int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | 101 | int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
@@ -536,7 +536,7 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc | |||
536 | } | 536 | } |
537 | 537 | ||
538 | scsi_print_command(sc); | 538 | scsi_print_command(sc); |
539 | printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %d\n", | 539 | printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %llu\n", |
540 | ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun); | 540 | ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun); |
541 | printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, " | 541 | printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, " |
542 | "resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow, | 542 | "resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow, |
@@ -692,7 +692,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
692 | */ | 692 | */ |
693 | if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && | 693 | if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && |
694 | pScsiReply->ResponseInfo) { | 694 | pScsiReply->ResponseInfo) { |
695 | printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%d] " | 695 | printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%llu] " |
696 | "FCP_ResponseInfo=%08xh\n", ioc->name, | 696 | "FCP_ResponseInfo=%08xh\n", ioc->name, |
697 | sc->device->host->host_no, sc->device->channel, | 697 | sc->device->host->host_no, sc->device->channel, |
698 | sc->device->id, sc->device->lun, | 698 | sc->device->id, sc->device->lun, |
@@ -1155,7 +1155,7 @@ mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSI | |||
1155 | return; | 1155 | return; |
1156 | ioc = hd->ioc; | 1156 | ioc = hd->ioc; |
1157 | if (time - hd->last_queue_full > 10 * HZ) { | 1157 | if (time - hd->last_queue_full > 10 * HZ) { |
1158 | dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n", | 1158 | dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%llu) reported QUEUE_FULL!\n", |
1159 | ioc->name, 0, sc->device->id, sc->device->lun)); | 1159 | ioc->name, 0, sc->device->id, sc->device->lun)); |
1160 | hd->last_queue_full = time; | 1160 | hd->last_queue_full = time; |
1161 | } | 1161 | } |
@@ -1518,7 +1518,7 @@ mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx) | |||
1518 | * | 1518 | * |
1519 | **/ | 1519 | **/ |
1520 | int | 1520 | int |
1521 | mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, | 1521 | mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, u64 lun, |
1522 | int ctx2abort, ulong timeout) | 1522 | int ctx2abort, ulong timeout) |
1523 | { | 1523 | { |
1524 | MPT_FRAME_HDR *mf; | 1524 | MPT_FRAME_HDR *mf; |
@@ -2380,7 +2380,7 @@ mptscsih_slave_configure(struct scsi_device *sdev) | |||
2380 | vdevice = sdev->hostdata; | 2380 | vdevice = sdev->hostdata; |
2381 | 2381 | ||
2382 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2382 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2383 | "device @ %p, channel=%d, id=%d, lun=%d\n", | 2383 | "device @ %p, channel=%d, id=%d, lun=%llu\n", |
2384 | ioc->name, sdev, sdev->channel, sdev->id, sdev->lun)); | 2384 | ioc->name, sdev, sdev->channel, sdev->id, sdev->lun)); |
2385 | if (ioc->bus_type == SPI) | 2385 | if (ioc->bus_type == SPI) |
2386 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2386 | dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
@@ -2971,7 +2971,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) | |||
2971 | + (my_idx * MPT_SENSE_BUFFER_ALLOC)); | 2971 | + (my_idx * MPT_SENSE_BUFFER_ALLOC)); |
2972 | 2972 | ||
2973 | devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2973 | devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2974 | "%s: Sending Command 0x%02x for fw_channel=%d fw_id=%d lun=%d\n", | 2974 | "%s: Sending Command 0x%02x for fw_channel=%d fw_id=%d lun=%llu\n", |
2975 | ioc->name, __func__, cmd, io->channel, io->id, io->lun)); | 2975 | ioc->name, __func__, cmd, io->channel, io->id, io->lun)); |
2976 | 2976 | ||
2977 | if (dir == MPI_SCSIIO_CONTROL_READ) | 2977 | if (dir == MPI_SCSIIO_CONTROL_READ) |
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 99e3390807f3..e1b1a198a62a 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h | |||
@@ -98,7 +98,7 @@ typedef struct _internal_cmd { | |||
98 | u8 cmd; /* SCSI Op Code */ | 98 | u8 cmd; /* SCSI Op Code */ |
99 | u8 channel; /* bus number */ | 99 | u8 channel; /* bus number */ |
100 | u8 id; /* SCSI ID (virtual) */ | 100 | u8 id; /* SCSI ID (virtual) */ |
101 | int lun; | 101 | u64 lun; |
102 | u8 flags; /* Bit Field - See above */ | 102 | u8 flags; /* Bit Field - See above */ |
103 | u8 physDiskNum; /* Phys disk number, -1 else */ | 103 | u8 physDiskNum; /* Phys disk number, -1 else */ |
104 | u8 rsvd2; | 104 | u8 rsvd2; |
@@ -115,7 +115,7 @@ extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *); | |||
115 | extern const char * mptscsih_info(struct Scsi_Host *SChost); | 115 | extern const char * mptscsih_info(struct Scsi_Host *SChost); |
116 | extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt); | 116 | extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt); |
117 | extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, | 117 | extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, |
118 | u8 id, int lun, int ctx2abort, ulong timeout); | 118 | u8 id, u64 lun, int ctx2abort, ulong timeout); |
119 | extern void mptscsih_slave_destroy(struct scsi_device *device); | 119 | extern void mptscsih_slave_destroy(struct scsi_device *device); |
120 | extern int mptscsih_slave_configure(struct scsi_device *device); | 120 | extern int mptscsih_slave_configure(struct scsi_device *device); |
121 | extern int mptscsih_abort(struct scsi_cmnd * SCpnt); | 121 | extern int mptscsih_abort(struct scsi_cmnd * SCpnt); |
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c index 1d31d7284cbd..e7de92c67cf6 100644 --- a/drivers/message/i2o/i2o_scsi.c +++ b/drivers/message/i2o/i2o_scsi.c | |||
@@ -78,7 +78,7 @@ static unsigned int i2o_scsi_max_lun = 255; | |||
78 | struct i2o_scsi_host { | 78 | struct i2o_scsi_host { |
79 | struct Scsi_Host *scsi_host; /* pointer to the SCSI host */ | 79 | struct Scsi_Host *scsi_host; /* pointer to the SCSI host */ |
80 | struct i2o_controller *iop; /* pointer to the I2O controller */ | 80 | struct i2o_controller *iop; /* pointer to the I2O controller */ |
81 | unsigned int lun; /* lun's used for block devices */ | 81 | u64 lun; /* lun's used for block devices */ |
82 | struct i2o_device *channel[0]; /* channel->i2o_dev mapping table */ | 82 | struct i2o_device *channel[0]; /* channel->i2o_dev mapping table */ |
83 | }; | 83 | }; |
84 | 84 | ||
@@ -287,9 +287,8 @@ static int i2o_scsi_probe(struct device *dev) | |||
287 | } | 287 | } |
288 | 288 | ||
289 | if (le64_to_cpu(lun) >= scsi_host->max_lun) { | 289 | if (le64_to_cpu(lun) >= scsi_host->max_lun) { |
290 | osm_warn("SCSI device lun (%lu) >= max_lun of I2O host (%d)", | 290 | osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%d)", |
291 | (long unsigned int)le64_to_cpu(lun), | 291 | le64_to_cpu(lun), scsi_host->max_lun); |
292 | scsi_host->max_lun); | ||
293 | return -EFAULT; | 292 | return -EFAULT; |
294 | } | 293 | } |
295 | 294 | ||
@@ -308,9 +307,9 @@ static int i2o_scsi_probe(struct device *dev) | |||
308 | if (rc) | 307 | if (rc) |
309 | goto err; | 308 | goto err; |
310 | 309 | ||
311 | osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n", | 310 | osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %llu\n", |
312 | i2o_dev->lct_data.tid, channel, le32_to_cpu(id), | 311 | i2o_dev->lct_data.tid, channel, le32_to_cpu(id), |
313 | (long unsigned int)le64_to_cpu(lun)); | 312 | le64_to_cpu(lun)); |
314 | 313 | ||
315 | return 0; | 314 | return 0; |
316 | 315 | ||