1 diff -ur lin_tape-3.0.8.orig/lin_tape_scsi_config.c lin_tape-3.0.8/lin_tape_scsi_config.c
2 --- lin_tape-3.0.8.orig/lin_tape_scsi_config.c 2016-06-19 13:11:34.000000000 +0200
3 +++ lin_tape-3.0.8/lin_tape_scsi_config.c 2016-06-19 13:12:01.245509373 +0200
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
9 + struct inode* inode = filp->f_path.dentry->d_inode;
11 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
12 struct inode* inode = filp->f_dentry->d_inode;
16 minor = iminor(inode);
18 @@ -7459,7 +7463,11 @@
20 boolean des_locked = False, drv_locked = False;
22 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
23 + minor = iminor(file->f_path.dentry->d_inode);
25 minor = iminor(file->f_dentry->d_inode);
27 DbgPrint(("lin_tape_read entry: minor %d\n", minor));
29 if(minor >= LinTapeChangerOffset) {
30 @@ -7566,7 +7574,11 @@
32 boolean des_locked = False, drv_locked = False;
34 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
35 + minor = iminor(file->f_path.dentry->d_inode);
37 minor = iminor(file->f_dentry->d_inode);
39 DbgPrint(("lin_tape_write entry: minor %d\n", minor));
41 if(minor >= LinTapeChangerOffset) {
42 diff -ur lin_tape-3.0.8.orig/lin_tape_scsi_config.h lin_tape-3.0.8/lin_tape_scsi_config.h
43 --- lin_tape-3.0.8.orig/lin_tape_scsi_config.h 2016-03-07 20:19:02.000000000 +0100
44 +++ lin_tape-3.0.8/lin_tape_scsi_config.h 2016-06-19 13:13:48.613514050 +0200
46 static int lin_tape_probe(struct device *dev);
47 static int lin_tape_remove(struct device *dev);
48 static struct scsi_driver lin_tape_driver = {
49 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
54 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
55 + .owner = THIS_MODULE,
57 .probe = lin_tape_probe,
58 .remove = lin_tape_remove,
60 diff -ur lin_tape-3.0.8.orig/sgmp.c lin_tape-3.0.8/sgmp.c
61 --- lin_tape-3.0.8.orig/sgmp.c 2016-06-19 13:11:34.000000000 +0200
62 +++ lin_tape-3.0.8/sgmp.c 2016-06-19 13:12:08.182262293 +0200
66 return put_user(sdp->device->host->hostt->emulated, ip);
67 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
73 return (scsi_reset_provider(sdp->device, val) ==
76 case SCSI_IOCTL_SEND_COMMAND:
79 @@ -1281,9 +1283,16 @@
80 case SCSI_IOCTL_GET_BUS_NUMBER:
81 case SCSI_IOCTL_PROBE_HOST:
82 case SG_GET_TRANSFORM:
83 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
88 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
89 return pfo_scsi_ioctl(sdp->device, cmd_in, p);
94 return put_user(queue_max_sectors(sdp->device->request_queue) * 512,
96 @@ -1302,8 +1311,19 @@
99 return -EPERM; /* don't know so take safe approach */
100 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
101 return pfo_scsi_ioctl(sdp->device, cmd_in, p);
106 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
107 + result = scsi_ioctl_block_when_processing_errors(sdp->device,
108 + cmd_in, filp->f_flags & O_NDELAY);
111 + return pfo_scsi_ioctl(sdp->device, cmd_in, p);
116 diff -ur lin_tape-3.0.8.orig/stmp.c lin_tape-3.0.8/stmp.c
117 --- lin_tape-3.0.8.orig/stmp.c 2016-06-19 13:11:34.000000000 +0200
118 +++ lin_tape-3.0.8/stmp.c 2016-06-19 13:12:36.339279356 +0200
122 static struct scsi_driver st_template = {
123 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
124 .owner = THIS_MODULE,
128 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
129 + .owner = THIS_MODULE,
131 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
132 .groups = st_drv_groups,
134 @@ -3514,6 +3519,7 @@
135 STm = &(STp->modes[STp->current_mode]);
136 STps = &(STp->ps[STp->partition]);
138 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
140 * If we are in the middle of error recovery, don't let anyone
141 * else try and use this device. Also, if error recovery fails, it
142 @@ -3525,6 +3531,12 @@
143 if (!scsi_block_when_processing_errors(STp->device) || retval != -ENODEV)
147 + retval = scsi_ioctl_block_when_processing_errors(STp->device, cmd_in,
148 + file->f_flags & O_NDELAY);
153 cmd_type = _IOC_TYPE(cmd_in);
154 cmd_nr = _IOC_NR(cmd_in);