mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
scsi: split scsi_nonblockable_ioctl
The calling conventions for this function are bad as it could return -ENODEV both for a device not currently online and a not recognized ioctl. Add a new scsi_ioctl_block_when_processing_errors function that wraps scsi_block_when_processing_errors with the a special case for the SG_SCSI_RESET ioctl command, and handle the SG_SCSI_RESET case itself in scsi_ioctl. All callers of scsi_ioctl now must call the above helper to check for the EH state, so that the ioctl handler itself doesn't have to. Reported-by: Robert Elliott <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
This commit is contained in:
parent
176aa9d6ee
commit
906d15fbd2
8 changed files with 49 additions and 74 deletions
|
|
@ -40,9 +40,9 @@ typedef struct scsi_fctargaddress {
|
|||
unsigned char host_wwn[8]; // include NULL term.
|
||||
} Scsi_FCTargAddress;
|
||||
|
||||
int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev,
|
||||
int cmd, bool ndelay);
|
||||
extern int scsi_ioctl(struct scsi_device *, int, void __user *);
|
||||
extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,
|
||||
void __user *arg, int ndelay);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _SCSI_IOCTL_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue