···277277 * @filp: either NULL or a &struct file which must have the O_NONBLOCK flag.278278 */279279int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,280280- void __user *arg, struct file *filp)280280+ void __user *arg, int ndelay)281281{282282 int val, result;283283284284 /* The first set of iocts may be executed even if we're doing285285 * error processing, as long as the device was opened286286 * non-blocking */287287- if (filp && (filp->f_flags & O_NONBLOCK)) {287287+ if (ndelay) {288288 if (scsi_host_in_recovery(sdev->host))289289 return -ENODEV;290290 } else if (!scsi_block_when_processing_errors(sdev))
+2-1
drivers/scsi/sd.c
···761761 * may try and take the device offline, in which case all further762762 * access to the device is prohibited.763763 */764764- error = scsi_nonblockable_ioctl(sdp, cmd, p, filp);764764+ error = scsi_nonblockable_ioctl(sdp, cmd, p,765765+ filp ? filp->f_flags & O_NDELAY : 0);765766 if (!scsi_block_when_processing_errors(sdp) || !error)766767 return error;767768
+2-1
drivers/scsi/sr.c
···524524 * case fall through to scsi_ioctl, which will return ENDOEV again525525 * if it doesn't recognise the ioctl526526 */527527- ret = scsi_nonblockable_ioctl(sdev, cmd, argp, NULL);527527+ ret = scsi_nonblockable_ioctl(sdev, cmd, argp,528528+ file ? file->f_flags & O_NDELAY : 0);528529 if (ret != -ENODEV)529530 return ret;530531 return scsi_ioctl(sdev, cmd, argp);
+2-1
drivers/scsi/st.c
···32633263 * may try and take the device offline, in which case all further32643264 * access to the device is prohibited.32653265 */32663266- retval = scsi_nonblockable_ioctl(STp->device, cmd_in, p, file);32663266+ retval = scsi_nonblockable_ioctl(STp->device, cmd_in, p,32673267+ file->f_flags & O_NDELAY);32673268 if (!scsi_block_when_processing_errors(STp->device) || retval != -ENODEV)32683269 goto out;32693270 retval = 0;
+1-1
include/scsi/scsi_ioctl.h
···42424343extern int scsi_ioctl(struct scsi_device *, int, void __user *);4444extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd,4545- void __user *arg, struct file *filp);4545+ void __user *arg, int ndelay);46464747#endif /* __KERNEL__ */4848#endif /* _SCSI_IOCTL_H */