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>
This commit is contained in:
Hannes Reinecke
2014-06-25 15:27:36 +02:00
committed by Christoph Hellwig
parent 755f516bbb
commit 9cb78c16f5
86 changed files with 438 additions and 429 deletions

View File

@@ -385,7 +385,7 @@ struct scsi_lun {
#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2)
#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3)
static inline int scsi_is_wlun(unsigned int lun)
static inline int scsi_is_wlun(u64 lun)
{
return (lun & 0xff00) == SCSI_W_LUN_BASE;
}

View File

@@ -98,8 +98,8 @@ struct scsi_device {
unsigned long last_queue_ramp_up; /* last queue ramp up time */
unsigned int id, lun, channel;
unsigned int id, channel;
u64 lun;
unsigned int manufacturer; /* Manufacturer of device, for using
* vendor-specific cmd's */
unsigned sector_size; /* size in bytes */
@@ -321,9 +321,9 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev)
dev_printk(prefix, &(starget)->dev, fmt, ##a)
extern struct scsi_device *__scsi_add_device(struct Scsi_Host *,
uint, uint, uint, void *hostdata);
uint, uint, u64, void *hostdata);
extern int scsi_add_device(struct Scsi_Host *host, uint channel,
uint target, uint lun);
uint target, u64 lun);
extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh);
extern void scsi_remove_device(struct scsi_device *);
extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
@@ -332,13 +332,13 @@ void scsi_attach_vpd(struct scsi_device *sdev);
extern int scsi_device_get(struct scsi_device *);
extern void scsi_device_put(struct scsi_device *);
extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *,
uint, uint, uint);
uint, uint, u64);
extern struct scsi_device *__scsi_device_lookup(struct Scsi_Host *,
uint, uint, uint);
uint, uint, u64);
extern struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *,
uint);
u64);
extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *,
uint);
u64);
extern void starget_for_each_device(struct scsi_target *, void *,
void (*fn)(struct scsi_device *, void *));
extern void __starget_for_each_device(struct scsi_target *, void *,
@@ -411,13 +411,13 @@ extern void scsi_device_resume(struct scsi_device *sdev);
extern void scsi_target_quiesce(struct scsi_target *);
extern void scsi_target_resume(struct scsi_target *);
extern void scsi_scan_target(struct device *parent, unsigned int channel,
unsigned int id, unsigned int lun, int rescan);
unsigned int id, u64 lun, int rescan);
extern void scsi_target_reap(struct scsi_target *);
extern void scsi_target_block(struct device *);
extern void scsi_target_unblock(struct device *, enum scsi_device_state);
extern void scsi_remove_target(struct device *);
extern void int_to_scsilun(unsigned int, struct scsi_lun *);
extern int scsilun_to_int(struct scsi_lun *);
extern void int_to_scsilun(u64, struct scsi_lun *);
extern u64 scsilun_to_int(struct scsi_lun *);
extern const char *scsi_device_state_name(enum scsi_device_state);
extern int scsi_is_sdev_device(const struct device *);
extern int scsi_is_target_device(const struct device *);

View File

@@ -35,7 +35,7 @@ struct scsi_transport_template {
/*
* If set, called from sysfs and legacy procfs rescanning code.
*/
int (*user_scan)(struct Scsi_Host *, uint, uint, uint);
int (*user_scan)(struct Scsi_Host *, uint, uint, u64);
/* The size of the specific transport attribute structure (a
* space of this size will be left at the end of the