aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-06-25 09:27:36 -0400
committerChristoph Hellwig <hch@lst.de>2014-07-17 16:07:37 -0400
commit9cb78c16f5dadefd8dc5ba0ae5a2f26cd59419b3 (patch)
tree576b86c3ec56dd7176285ec2d27f27ca55f77bc3 /drivers/scsi/scsi_sysfs.c
parent755f516bbb983915d6cbfb5aa592cc0a5a99fd00 (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/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 074e8cc30955..5f36788705ba 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -80,7 +80,7 @@ const char *scsi_host_state_name(enum scsi_host_state state)
80 return name; 80 return name;
81} 81}
82 82
83static int check_set(unsigned int *val, char *src) 83static int check_set(unsigned long long *val, char *src)
84{ 84{
85 char *last; 85 char *last;
86 86
@@ -90,7 +90,7 @@ static int check_set(unsigned int *val, char *src)
90 /* 90 /*
91 * Doesn't check for int overflow 91 * Doesn't check for int overflow
92 */ 92 */
93 *val = simple_strtoul(src, &last, 0); 93 *val = simple_strtoull(src, &last, 0);
94 if (*last != '\0') 94 if (*last != '\0')
95 return 1; 95 return 1;
96 } 96 }
@@ -99,11 +99,11 @@ static int check_set(unsigned int *val, char *src)
99 99
100static int scsi_scan(struct Scsi_Host *shost, const char *str) 100static int scsi_scan(struct Scsi_Host *shost, const char *str)
101{ 101{
102 char s1[15], s2[15], s3[15], junk; 102 char s1[15], s2[15], s3[17], junk;
103 unsigned int channel, id, lun; 103 unsigned long long channel, id, lun;
104 int res; 104 int res;
105 105
106 res = sscanf(str, "%10s %10s %10s %c", s1, s2, s3, &junk); 106 res = sscanf(str, "%10s %10s %16s %c", s1, s2, s3, &junk);
107 if (res != 3) 107 if (res != 3)
108 return -EINVAL; 108 return -EINVAL;
109 if (check_set(&channel, s1)) 109 if (check_set(&channel, s1))
@@ -1230,13 +1230,13 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
1230 device_initialize(&sdev->sdev_gendev); 1230 device_initialize(&sdev->sdev_gendev);
1231 sdev->sdev_gendev.bus = &scsi_bus_type; 1231 sdev->sdev_gendev.bus = &scsi_bus_type;
1232 sdev->sdev_gendev.type = &scsi_dev_type; 1232 sdev->sdev_gendev.type = &scsi_dev_type;
1233 dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d", 1233 dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu",
1234 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1234 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1235 1235
1236 device_initialize(&sdev->sdev_dev); 1236 device_initialize(&sdev->sdev_dev);
1237 sdev->sdev_dev.parent = get_device(&sdev->sdev_gendev); 1237 sdev->sdev_dev.parent = get_device(&sdev->sdev_gendev);
1238 sdev->sdev_dev.class = &sdev_class; 1238 sdev->sdev_dev.class = &sdev_class;
1239 dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", 1239 dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%llu",
1240 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1240 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
1241 sdev->scsi_level = starget->scsi_level; 1241 sdev->scsi_level = starget->scsi_level;
1242 transport_setup_device(&sdev->sdev_gendev); 1242 transport_setup_device(&sdev->sdev_gendev);