diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
commit | 9b73e76f3cf63379dcf45fcd4f112f5812418d0a (patch) | |
tree | 4e6bef87cd0cd6d848fc39a5ae25b981dbbe035b /drivers/scsi/scsi_ioctl.c | |
parent | 50d9a126240f9961cfdd063336bbeb91f77a7dce (diff) | |
parent | 23c3e290fb9ce38cabc2822b47583fc8702411bf (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits)
[SCSI] usbstorage: use last_sector_bug flag universally
[SCSI] libsas: abstract STP task status into a function
[SCSI] ultrastor: clean up inline asm warnings
[SCSI] aic7xxx: fix firmware build
[SCSI] aacraid: fib context lock for management ioctls
[SCSI] ch: remove forward declarations
[SCSI] ch: fix device minor number management bug
[SCSI] ch: handle class_device_create failure properly
[SCSI] NCR5380: fix section mismatch
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
[SCSI] IB/iSER: add logical unit reset support
[SCSI] don't use __GFP_DMA for sense buffers if not required
[SCSI] use dynamically allocated sense buffer
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
[SCSI] sd: add fix for devices with last sector access problems
[SCSI] fix pcmcia compile problem
[SCSI] aacraid: add Voodoo Lite class of cards.
[SCSI] aacraid: add new driver features flags
[SCSI] qla2xxx: Update version number to 8.02.00-k7.
[SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
...
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 32293f451669..28b19ef26309 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -174,10 +174,15 @@ static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) | |||
174 | } | 174 | } |
175 | 175 | ||
176 | 176 | ||
177 | /* | 177 | /** |
178 | * the scsi_ioctl() function differs from most ioctls in that it does | 178 | * scsi_ioctl - Dispatch ioctl to scsi device |
179 | * not take a major/minor number as the dev field. Rather, it takes | 179 | * @sdev: scsi device receiving ioctl |
180 | * a pointer to a scsi_devices[] element, a structure. | 180 | * @cmd: which ioctl is it |
181 | * @arg: data associated with ioctl | ||
182 | * | ||
183 | * Description: The scsi_ioctl() function differs from most ioctls in that it | ||
184 | * does not take a major/minor number as the dev field. Rather, it takes | ||
185 | * a pointer to a &struct scsi_device. | ||
181 | */ | 186 | */ |
182 | int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 187 | int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) |
183 | { | 188 | { |
@@ -239,7 +244,7 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
239 | return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); | 244 | return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); |
240 | case SCSI_IOCTL_TEST_UNIT_READY: | 245 | case SCSI_IOCTL_TEST_UNIT_READY: |
241 | return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT, | 246 | return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT, |
242 | NORMAL_RETRIES); | 247 | NORMAL_RETRIES, NULL); |
243 | case SCSI_IOCTL_START_UNIT: | 248 | case SCSI_IOCTL_START_UNIT: |
244 | scsi_cmd[0] = START_STOP; | 249 | scsi_cmd[0] = START_STOP; |
245 | scsi_cmd[1] = 0; | 250 | scsi_cmd[1] = 0; |
@@ -264,9 +269,12 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
264 | } | 269 | } |
265 | EXPORT_SYMBOL(scsi_ioctl); | 270 | EXPORT_SYMBOL(scsi_ioctl); |
266 | 271 | ||
267 | /* | 272 | /** |
268 | * the scsi_nonblock_ioctl() function is designed for ioctls which may | 273 | * scsi_nonblock_ioctl() - Handle SG_SCSI_RESET |
269 | * be executed even if the device is in recovery. | 274 | * @sdev: scsi device receiving ioctl |
275 | * @cmd: Must be SC_SCSI_RESET | ||
276 | * @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. | ||
270 | */ | 278 | */ |
271 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 279 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
272 | void __user *arg, struct file *filp) | 280 | void __user *arg, struct file *filp) |
@@ -276,7 +284,7 @@ int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | |||
276 | /* The first set of iocts may be executed even if we're doing | 284 | /* The first set of iocts may be executed even if we're doing |
277 | * error processing, as long as the device was opened | 285 | * error processing, as long as the device was opened |
278 | * non-blocking */ | 286 | * non-blocking */ |
279 | if (filp && filp->f_flags & O_NONBLOCK) { | 287 | if (filp && (filp->f_flags & O_NONBLOCK)) { |
280 | if (scsi_host_in_recovery(sdev->host)) | 288 | if (scsi_host_in_recovery(sdev->host)) |
281 | return -ENODEV; | 289 | return -ENODEV; |
282 | } else if (!scsi_block_when_processing_errors(sdev)) | 290 | } else if (!scsi_block_when_processing_errors(sdev)) |