diff -ur lin_tape-3.0.8.orig/lin_tape_scsi_config.c lin_tape-3.0.8/lin_tape_scsi_config.c --- lin_tape-3.0.8.orig/lin_tape_scsi_config.c 2016-06-19 13:11:34.000000000 +0200 +++ lin_tape-3.0.8/lin_tape_scsi_config.c 2016-06-19 13:12:01.245509373 +0200 @@ -7191,9 +7191,13 @@ { int rc = -EIO; int minor = -1; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + struct inode* inode = filp->f_path.dentry->d_inode; +#else #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) struct inode* inode = filp->f_dentry->d_inode; #endif +#endif minor = iminor(inode); @@ -7459,7 +7463,11 @@ int dev_index = 0; boolean des_locked = False, drv_locked = False; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + minor = iminor(file->f_path.dentry->d_inode); +#else minor = iminor(file->f_dentry->d_inode); +#endif DbgPrint(("lin_tape_read entry: minor %d\n", minor)); if(minor >= LinTapeChangerOffset) { @@ -7566,7 +7574,11 @@ int dev_index = 0; boolean des_locked = False, drv_locked = False; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + minor = iminor(file->f_path.dentry->d_inode); +#else minor = iminor(file->f_dentry->d_inode); +#endif DbgPrint(("lin_tape_write entry: minor %d\n", minor)); if(minor >= LinTapeChangerOffset) { diff -ur lin_tape-3.0.8.orig/lin_tape_scsi_config.h lin_tape-3.0.8/lin_tape_scsi_config.h --- lin_tape-3.0.8.orig/lin_tape_scsi_config.h 2016-03-07 20:19:02.000000000 +0100 +++ lin_tape-3.0.8/lin_tape_scsi_config.h 2016-06-19 13:13:48.613514050 +0200 @@ -315,9 +315,14 @@ static int lin_tape_probe(struct device *dev); static int lin_tape_remove(struct device *dev); static struct scsi_driver lin_tape_driver = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) .owner = THIS_MODULE, +#endif .gendrv = { .name = "lin_tape", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + .owner = THIS_MODULE, +#endif .probe = lin_tape_probe, .remove = lin_tape_remove, }, diff -ur lin_tape-3.0.8.orig/sgmp.c lin_tape-3.0.8/sgmp.c --- lin_tape-3.0.8.orig/sgmp.c 2016-06-19 13:11:34.000000000 +0200 +++ lin_tape-3.0.8/sgmp.c 2016-06-19 13:12:08.182262293 +0200 @@ -1223,6 +1223,7 @@ if (sdp->detached) return -ENODEV; return put_user(sdp->device->host->hostt->emulated, ip); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) case SG_SCSI_RESET: if (sdp->detached) return -ENODEV; @@ -1256,6 +1257,7 @@ return -EACCES; return (scsi_reset_provider(sdp->device, val) == SUCCESS) ? 0 : -EIO; +#endif case SCSI_IOCTL_SEND_COMMAND: if (sdp->detached) return -ENODEV; @@ -1281,9 +1283,16 @@ case SCSI_IOCTL_GET_BUS_NUMBER: case SCSI_IOCTL_PROBE_HOST: case SG_GET_TRANSFORM: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + case SG_SCSI_RESET: +#endif if (sdp->detached) return -ENODEV; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) return pfo_scsi_ioctl(sdp->device, cmd_in, p); +#else + break; +#endif case BLKSECTGET: return put_user(queue_max_sectors(sdp->device->request_queue) * 512, ip); @@ -1302,8 +1311,19 @@ default: if (read_only) return -EPERM; /* don't know so take safe approach */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) return pfo_scsi_ioctl(sdp->device, cmd_in, p); +#else + break; +#endif } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + result = scsi_ioctl_block_when_processing_errors(sdp->device, + cmd_in, filp->f_flags & O_NDELAY); + if (result) + return result; + return pfo_scsi_ioctl(sdp->device, cmd_in, p); +#endif } #ifdef CONFIG_COMPAT diff -ur lin_tape-3.0.8.orig/stmp.c lin_tape-3.0.8/stmp.c --- lin_tape-3.0.8.orig/stmp.c 2016-06-19 13:11:34.000000000 +0200 +++ lin_tape-3.0.8/stmp.c 2016-06-19 13:12:36.339279356 +0200 @@ -259,9 +259,14 @@ #endif static struct scsi_driver st_template = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) .owner = THIS_MODULE, +#endif .gendrv = { .name = "st", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + .owner = THIS_MODULE, +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) .groups = st_drv_groups, #endif @@ -3514,6 +3519,7 @@ STm = &(STp->modes[STp->current_mode]); STps = &(STp->ps[STp->partition]); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) /* * If we are in the middle of error recovery, don't let anyone * else try and use this device. Also, if error recovery fails, it @@ -3525,6 +3531,12 @@ if (!scsi_block_when_processing_errors(STp->device) || retval != -ENODEV) goto out; retval = 0; +#else + retval = scsi_ioctl_block_when_processing_errors(STp->device, cmd_in, + file->f_flags & O_NDELAY); + if (retval) + goto out; +#endif cmd_type = _IOC_TYPE(cmd_in); cmd_nr = _IOC_NR(cmd_in);