diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/scsi/scsi_ioctl.c | |
parent | 3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff) | |
parent | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff) |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index dc1cfb2fd76..b98f763931c 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -94,7 +94,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, | |||
94 | SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", *cmd)); | 94 | SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", *cmd)); |
95 | 95 | ||
96 | result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, | 96 | result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, |
97 | &sshdr, timeout, retries); | 97 | &sshdr, timeout, retries, NULL); |
98 | 98 | ||
99 | SCSI_LOG_IOCTL(2, printk("Ioctl returned 0x%x\n", result)); | 99 | SCSI_LOG_IOCTL(2, printk("Ioctl returned 0x%x\n", result)); |
100 | 100 | ||
@@ -167,10 +167,17 @@ EXPORT_SYMBOL(scsi_set_medium_removal); | |||
167 | static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) | 167 | static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) |
168 | { | 168 | { |
169 | struct device *dev = scsi_get_device(sdev->host); | 169 | struct device *dev = scsi_get_device(sdev->host); |
170 | const char *name; | ||
170 | 171 | ||
171 | if (!dev) | 172 | if (!dev) |
172 | return -ENXIO; | 173 | return -ENXIO; |
173 | return copy_to_user(arg, dev->bus_id, sizeof(dev->bus_id))? -EFAULT: 0; | 174 | |
175 | name = dev_name(dev); | ||
176 | |||
177 | /* compatibility with old ioctl which only returned | ||
178 | * 20 characters */ | ||
179 | return copy_to_user(arg, name, min(strlen(name), (size_t)20)) | ||
180 | ? -EFAULT: 0; | ||
174 | } | 181 | } |
175 | 182 | ||
176 | 183 | ||
@@ -270,11 +277,11 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
270 | EXPORT_SYMBOL(scsi_ioctl); | 277 | EXPORT_SYMBOL(scsi_ioctl); |
271 | 278 | ||
272 | /** | 279 | /** |
273 | * scsi_nonblock_ioctl() - Handle SG_SCSI_RESET | 280 | * scsi_nonblockable_ioctl() - Handle SG_SCSI_RESET |
274 | * @sdev: scsi device receiving ioctl | 281 | * @sdev: scsi device receiving ioctl |
275 | * @cmd: Must be SC_SCSI_RESET | 282 | * @cmd: Must be SC_SCSI_RESET |
276 | * @arg: pointer to int containing SG_SCSI_RESET_{DEVICE,BUS,HOST} | 283 | * @arg: pointer to int containing SG_SCSI_RESET_{DEVICE,BUS,HOST} |
277 | * @filp: either NULL or a &struct file which must have the O_NONBLOCK flag. | 284 | * @ndelay: file mode O_NDELAY flag |
278 | */ | 285 | */ |
279 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 286 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
280 | void __user *arg, int ndelay) | 287 | void __user *arg, int ndelay) |