]>
Commit | Line | Data |
---|---|---|
6986ddb6 JR |
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 | |
4 | @@ -7191,9 +7191,13 @@ | |
bc5f1107 JR |
5 | { |
6 | int rc = -EIO; | |
7 | int minor = -1; | |
8 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
9 | + struct inode* inode = filp->f_path.dentry->d_inode; | |
10 | +#else | |
11 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) | |
12 | struct inode* inode = filp->f_dentry->d_inode; | |
13 | #endif | |
14 | +#endif | |
15 | ||
16 | minor = iminor(inode); | |
17 | ||
6986ddb6 | 18 | @@ -7459,7 +7463,11 @@ |
bc5f1107 JR |
19 | int dev_index = 0; |
20 | boolean des_locked = False, drv_locked = False; | |
21 | ||
22 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
23 | + minor = iminor(file->f_path.dentry->d_inode); | |
24 | +#else | |
25 | minor = iminor(file->f_dentry->d_inode); | |
26 | +#endif | |
27 | DbgPrint(("lin_tape_read entry: minor %d\n", minor)); | |
28 | ||
29 | if(minor >= LinTapeChangerOffset) { | |
6986ddb6 | 30 | @@ -7566,7 +7574,11 @@ |
bc5f1107 JR |
31 | int dev_index = 0; |
32 | boolean des_locked = False, drv_locked = False; | |
33 | ||
34 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
35 | + minor = iminor(file->f_path.dentry->d_inode); | |
36 | +#else | |
37 | minor = iminor(file->f_dentry->d_inode); | |
38 | +#endif | |
39 | DbgPrint(("lin_tape_write entry: minor %d\n", minor)); | |
40 | ||
41 | if(minor >= LinTapeChangerOffset) { | |
6986ddb6 JR |
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 | |
45 | @@ -315,9 +315,14 @@ | |
bc5f1107 JR |
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) | |
50 | .owner = THIS_MODULE, | |
51 | +#endif | |
52 | .gendrv = { | |
53 | .name = "lin_tape", | |
6986ddb6 JR |
54 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) |
55 | + .owner = THIS_MODULE, | |
56 | +#endif | |
bc5f1107 | 57 | .probe = lin_tape_probe, |
6986ddb6 JR |
58 | .remove = lin_tape_remove, |
59 | }, | |
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 | |
63 | @@ -1223,6 +1223,7 @@ | |
64 | if (sdp->detached) | |
65 | return -ENODEV; | |
66 | return put_user(sdp->device->host->hostt->emulated, ip); | |
67 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) | |
68 | case SG_SCSI_RESET: | |
69 | if (sdp->detached) | |
70 | return -ENODEV; | |
71 | @@ -1256,6 +1257,7 @@ | |
72 | return -EACCES; | |
73 | return (scsi_reset_provider(sdp->device, val) == | |
74 | SUCCESS) ? 0 : -EIO; | |
75 | +#endif | |
76 | case SCSI_IOCTL_SEND_COMMAND: | |
77 | if (sdp->detached) | |
78 | return -ENODEV; | |
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) | |
84 | + case SG_SCSI_RESET: | |
85 | +#endif | |
86 | if (sdp->detached) | |
87 | return -ENODEV; | |
88 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) | |
89 | return pfo_scsi_ioctl(sdp->device, cmd_in, p); | |
90 | +#else | |
91 | + break; | |
92 | +#endif | |
93 | case BLKSECTGET: | |
94 | return put_user(queue_max_sectors(sdp->device->request_queue) * 512, | |
95 | ip); | |
96 | @@ -1302,8 +1311,19 @@ | |
97 | default: | |
98 | if (read_only) | |
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); | |
102 | +#else | |
103 | + break; | |
104 | +#endif | |
105 | } | |
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); | |
109 | + if (result) | |
110 | + return result; | |
111 | + return pfo_scsi_ioctl(sdp->device, cmd_in, p); | |
112 | +#endif | |
113 | } | |
114 | ||
115 | #ifdef CONFIG_COMPAT | |
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 | |
119 | @@ -259,9 +259,14 @@ | |
120 | #endif | |
121 | ||
122 | static struct scsi_driver st_template = { | |
123 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) | |
124 | .owner = THIS_MODULE, | |
125 | +#endif | |
126 | .gendrv = { | |
127 | .name = "st", | |
128 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
129 | + .owner = THIS_MODULE, | |
130 | +#endif | |
131 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) | |
132 | .groups = st_drv_groups, | |
133 | #endif | |
134 | @@ -3514,6 +3519,7 @@ | |
135 | STm = &(STp->modes[STp->current_mode]); | |
136 | STps = &(STp->ps[STp->partition]); | |
137 | ||
138 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) | |
139 | /* | |
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) | |
144 | goto out; | |
145 | retval = 0; | |
146 | +#else | |
147 | + retval = scsi_ioctl_block_when_processing_errors(STp->device, cmd_in, | |
148 | + file->f_flags & O_NDELAY); | |
149 | + if (retval) | |
150 | + goto out; | |
151 | +#endif | |
152 | ||
153 | cmd_type = _IOC_TYPE(cmd_in); | |
154 | cmd_nr = _IOC_NR(cmd_in); |