]> git.pld-linux.org Git - packages/lin_tape.git/blame - clean-ifdefs.patch
- up to 3.0.23
[packages/lin_tape.git] / clean-ifdefs.patch
CommitLineData
300a759d
JR
1diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
2--- lin_tape-3.0.18/Makefile 2017-05-09 21:11:32.977092391 +0200
3+++ lin_tape-3.0.18-ifdefs/Makefile 2017-05-09 21:05:59.610307494 +0200
4@@ -20,15 +20,6 @@
6986ddb6
JR
5 lin_tape-objs := join.o lin_tape_scsi_config.o lin_tape_scsi_tape.o lin_tape_scsi_trace.o \
6 lin_tape_ioctl_tape.o lin_tape_ioctl_changer.o lin_tape_extra_ioctl.o
7
8-RHELRELEASE := $(shell [ -f "/etc/redhat-release" ] && echo 1 || echo 0)
9-ifeq ($(RHELRELEASE), 1)
10-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
300a759d 11-KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
6986ddb6
JR
12-EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER}
13-else
14-EXTRA_CFLAGS += -DSLESVERSION
15-endif
300a759d
JR
16-
17 ifeq ($(SFMP), 1)
18 EXTRA_CFLAGS += -DSFMPENABLED
19 endif
20diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
21--- lin_tape-3.0.18/pfo.h 2017-02-23 19:14:41.000000000 +0100
22+++ lin_tape-3.0.18-ifdefs/pfo.h 2017-05-09 21:06:34.117699008 +0200
fda6bd2d 23@@ -26,133 +26,6 @@
6986ddb6
JR
24 * will build for various releases of Linux. This is how
25 * we track different versions using ifdef in the source.
26 */
27-#ifdef KERNELVERSION_2_6_32_220
28-#define BEFORE_RH_63 1
29-#define BEFORE_RH_64 1
30-#define BEFORE_RH_65 1
31-#define BEFORE_RH_66 1
32-#define BEFORE_RH_67 1
33-#define BEFORE_RH_70 1
34-#define BEFORE_RH_71 1
300a759d 35-#define BEFORE_RH_72 1
6986ddb6
JR
36-#endif
37-#ifdef KERNELVERSION_2_6_32_279
38-#define AFTER_RH_62 1
39-#define BEFORE_RH_64 1
40-#define BEFORE_RH_65 1
41-#define BEFORE_RH_66 1
42-#define BEFORE_RH_67 1
43-#define BEFORE_RH_70 1
44-#define BEFORE_RH_71 1
300a759d 45-#define BEFORE_RH_72 1
6986ddb6
JR
46-#endif
47-#ifdef KERNELVERSION_2_6_32_358
48-#define AFTER_RH_62 1
49-#define AFTER_RH_63 1
50-#define BEFORE_RH_65 1
51-#define BEFORE_RH_66 1
52-#define BEFORE_RH_67 1
53-#define BEFORE_RH_70 1
300a759d 54-#define BEFORE_RH_72 1
6986ddb6
JR
55-#endif
56-#ifdef KERNELVERSION_2_6_32_431
57-#define AFTER_RH_62 1
58-#define AFTER_RH_63 1
59-#define AFTER_RH_64 1
60-#define BEFORE_RH_66 1
61-#define BEFORE_RH_67 1
62-#define BEFORE_RH_70 1
63-#define BEFORE_RH_71 1
300a759d 64-#define BEFORE_RH_72 1
6986ddb6
JR
65-#endif
66-#ifdef KERNELVERSION_2_6_32_504
67-#define AFTER_RH_62 1
68-#define AFTER_RH_63 1
69-#define AFTER_RH_64 1
70-#define AFTER_RH_65 1
71-#define BEFORE_RH_67 1
72-#define BEFORE_RH_70 1
73-#define BEFORE_RH_71 1
300a759d 74-#define BEFORE_RH_72 1
6986ddb6
JR
75-#endif
76-#ifdef KERNELVERSION_2_6_32_573
77-#define AFTER_RH_62 1
78-#define AFTER_RH_63 1
79-#define AFTER_RH_64 1
80-#define AFTER_RH_65 1
81-#define AFTER_RH_66 1
82-#define BEFORE_RH_70 1
83-#define BEFORE_RH_71 1
300a759d
JR
84-#define BEFORE_RH_72 1
85-#endif
86-#ifdef KERNELVERSION_2_6_32_642
87-#define AFTER_RH_62 1
88-#define AFTER_RH_63 1
89-#define AFTER_RH_64 1
90-#define AFTER_RH_65 1
91-#define AFTER_RH_66 1
9752ce8d 92-#define AFTER_RH_67 1
300a759d
JR
93-#define BEFORE_RH_70 1
94-#define BEFORE_RH_71 1
95-#define BEFORE_RH_72 1
6986ddb6 96-#endif
fda6bd2d
JR
97-#ifdef KERNELVERSION_2_6_32_696
98-#define AFTER_RH_62 1
99-#define AFTER_RH_63 1
100-#define AFTER_RH_64 1
101-#define AFTER_RH_65 1
102-#define AFTER_RH_66 1
103-#define AFTER_RH_67 1
104-#define AFTER_RH_68 1
105-#define BEFORE_RH_70 1
106-#define BEFORE_RH_71 1
107-#define BEFORE_RH_72 1
108-#endif
6986ddb6
JR
109-#ifdef KERNELVERSION_3_10_0_123
110-#define AFTER_RH_62 1
111-#define AFTER_RH_63 1
112-#define AFTER_RH_64 1
113-#define AFTER_RH_65 1
114-#define AFTER_RH_66 1
115-#define AFTER_RH_67 1
116-#define AFTER_RH_6x 1
117-#define BEFORE_RH_71 1
118-#endif
119-#ifdef KERNELVERSION_3_10_0_229
120-#define AFTER_RH_62 1
121-#define AFTER_RH_63 1
122-#define AFTER_RH_64 1
123-#define AFTER_RH_65 1
124-#define AFTER_RH_66 1
125-#define AFTER_RH_67 1
126-#define AFTER_RH_6x 1
127-#define AFTER_RH_70 1
128-#define BEFORE_RH_72 1
129-#endif
130-#ifdef KERNELVERSION_3_10_0_327
9752ce8d
JR
131-#define AFTER_RH_62 1
132-#define AFTER_RH_63 1
133-#define AFTER_RH_64 1
134-#define AFTER_RH_65 1
135-#define AFTER_RH_66 1
136-#define AFTER_RH_67 1
137-#define AFTER_RH_6x 1
138-#define AFTER_RH_70 1
139-#define AFTER_RH_71 1
140-#endif
141-#ifdef KERNELVERSION_3_10_0_514
fda6bd2d
JR
142-#define AFTER_RH_62 1
143-#define AFTER_RH_63 1
144-#define AFTER_RH_64 1
145-#define AFTER_RH_65 1
146-#define AFTER_RH_66 1
147-#define AFTER_RH_67 1
148-#define AFTER_RH_6x 1
149-#define AFTER_RH_70 1
150-#define AFTER_RH_71 1
151-#define AFTER_RH_72 1
152-#endif
153-#ifdef KERNELVERSION_3_10_0_693
6986ddb6
JR
154 #define AFTER_RH_62 1
155 #define AFTER_RH_63 1
156 #define AFTER_RH_64 1
300a759d 157@@ -126,7 +35,6 @@
300a759d 158 #define AFTER_RH_71 1
9752ce8d 159 #define AFTER_RH_72 1
fda6bd2d 160 #define AFTER_RH_73 1
6986ddb6
JR
161-#endif
162
163 /* Misc defines needed so source is same for all versions of Linux */
164 #ifndef SDEV_TRANSPORT_OFFLINE
300a759d
JR
165diff -ur lin_tape-3.0.18/sgmp.c lin_tape-3.0.18-ifdefs/sgmp.c
166--- lin_tape-3.0.18/sgmp.c 2017-02-23 19:14:41.000000000 +0100
167+++ lin_tape-3.0.18-ifdefs/sgmp.c 2017-05-09 21:10:20.295643954 +0200
168@@ -262,27 +262,12 @@
6986ddb6
JR
169 {
170 struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
171
172-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
173- /* RHEL 7.0 and beyond */
174 struct request_queue *q = sfp->parentdp->device->request_queue;
175-#else
176-#ifdef AFTER_RH_63
177- /* RHEL 6.4+ */
178- struct request_queue *q = sfp->parentdp->device->request_queue;
179-#endif
180-#endif
300a759d 181
6986ddb6
JR
182 if (sfp->parentdp->device->type == TYPE_SCANNER)
183 return 0;
184
300a759d
JR
185-#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
186 return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
6986ddb6 187-#else
300a759d 188- /* RHEL 6.4 and beyond */
6986ddb6 189- return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
6986ddb6 190-#endif
300a759d
JR
191-//6.3 blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
192-
6986ddb6
JR
193 }
194
195 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
300a759d
JR
196@@ -419,7 +404,7 @@
197 #endif
198 sdp->sgdebug = 0;
199 q = sdp->device->request_queue;
200-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
201+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
202 sdp->sg_tablesize = min(queue_max_hw_segments(q),
203 queue_max_phys_segments(q));
204 #else
205@@ -1546,7 +1531,7 @@
6986ddb6
JR
206 if ((sdp->sgdebug > 0) &&
207 ((CHECK_CONDITION == srp->header.masked_status) ||
208 (COMMAND_TERMINATED == srp->header.masked_status)))
9752ce8d
JR
209-#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
210+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
6986ddb6
JR
211 __scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
212
213 #else
300a759d
JR
214@@ -1677,7 +1662,7 @@
215 INIT_LIST_HEAD(&sdp->sfds);
216 init_waitqueue_head(&sdp->o_excl_wait);
217
218-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
219+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
220 sdp->sg_tablesize = min(queue_max_hw_segments(q),
221 queue_max_phys_segments(q));
222 #else
223@@ -3069,7 +3054,7 @@
224 scsidp->id, scsidp->lun, (int) scsidp->type,
225 1,
226 (int) scsidp->queue_depth,
227-#ifdef AFTER_RH_71
228+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
229 (int) atomic_read(&scsidp->device_busy),
230 #else
231 (int) scsidp->device_busy,
232diff -ur lin_tape-3.0.18/stmp.c lin_tape-3.0.18-ifdefs/stmp.c
233--- lin_tape-3.0.18/stmp.c 2017-02-23 19:14:41.000000000 +0100
234+++ lin_tape-3.0.18-ifdefs/stmp.c 2017-05-09 21:11:01.113125428 +0200
235@@ -454,7 +454,7 @@
6986ddb6
JR
236 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
237 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
238 if (cmdstatp->have_sense)
9752ce8d
JR
239-#if defined(AFTER_RH_70) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
240+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
6986ddb6
JR
241 __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
242
243 #else
300a759d 244@@ -475,7 +475,7 @@
6986ddb6
JR
245 SRpnt->cmd[0] != MODE_SENSE &&
246 SRpnt->cmd[0] != TEST_UNIT_READY) {
9752ce8d
JR
247
248-#if defined(AFTER_RH_71) || LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
249+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,21)
6986ddb6
JR
250 __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
251
252 #else
300a759d
JR
253diff -ur lin_tape-3.0.18/upper.c lin_tape-3.0.18-ifdefs/upper.c
254--- lin_tape-3.0.18/upper.c 2017-02-23 19:14:41.000000000 +0100
255+++ lin_tape-3.0.18-ifdefs/upper.c 2017-05-09 21:09:37.868126006 +0200
256@@ -267,7 +267,7 @@
257 if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
258 return -EFAULT;
259
260-#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
261+#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
262 if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
263 #else
264 /* RHEL 6.4 and beyond */
265@@ -608,7 +608,7 @@
266 if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
267 goto error;
268
269-#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
270+#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
271 err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE);
272 #else
273 /* RHEL 6.4 and beyond */
This page took 0.053046 seconds and 4 git commands to generate.