]> git.pld-linux.org Git - packages/lin_tape.git/blame - clean-ifdefs.patch
- added and updated patches to make it build on non-RH anitquated kernels
[packages/lin_tape.git] / clean-ifdefs.patch
CommitLineData
6986ddb6
JR
1diff -ur lin_tape-3.0.8/Makefile lin_tape-3.0.8-norh/Makefile
2--- lin_tape-3.0.8/Makefile 2016-06-19 09:57:15.497134019 +0200
3+++ lin_tape-3.0.8-norh/Makefile 2016-06-19 09:53:34.317661494 +0200
4@@ -18,15 +18,6 @@
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
11-KERNELVER = $(shell cd ${KERNELDIR}; make kernelversion 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
12-EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER}
13-else
14-EXTRA_CFLAGS += -DSLESVERSION
15-endif
16-
17 PROC := $(shell uname -m)
18
19 ifeq ($(PROC), ppc64)
20diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
21--- lin_tape-3.0.8/pfo.h 2016-03-17 03:37:58.000000000 +0100
22+++ lin_tape-3.0.8-norh/pfo.h 2016-06-19 09:53:34.000000000 +0200
23@@ -26,82 +26,6 @@
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
35-#endif
36-#ifdef KERNELVERSION_2_6_32_279
37-#define AFTER_RH_62 1
38-#define BEFORE_RH_64 1
39-#define BEFORE_RH_65 1
40-#define BEFORE_RH_66 1
41-#define BEFORE_RH_67 1
42-#define BEFORE_RH_70 1
43-#define BEFORE_RH_71 1
44-#endif
45-#ifdef KERNELVERSION_2_6_32_358
46-#define AFTER_RH_62 1
47-#define AFTER_RH_63 1
48-#define BEFORE_RH_65 1
49-#define BEFORE_RH_66 1
50-#define BEFORE_RH_67 1
51-#define BEFORE_RH_70 1
52-#define BEFORE_RH_71 1
53-#endif
54-#ifdef KERNELVERSION_2_6_32_431
55-#define AFTER_RH_62 1
56-#define AFTER_RH_63 1
57-#define AFTER_RH_64 1
58-#define BEFORE_RH_66 1
59-#define BEFORE_RH_67 1
60-#define BEFORE_RH_70 1
61-#define BEFORE_RH_71 1
62-#endif
63-#ifdef KERNELVERSION_2_6_32_504
64-#define AFTER_RH_62 1
65-#define AFTER_RH_63 1
66-#define AFTER_RH_64 1
67-#define AFTER_RH_65 1
68-#define BEFORE_RH_67 1
69-#define BEFORE_RH_70 1
70-#define BEFORE_RH_71 1
71-#endif
72-#ifdef KERNELVERSION_2_6_32_573
73-#define AFTER_RH_62 1
74-#define AFTER_RH_63 1
75-#define AFTER_RH_64 1
76-#define AFTER_RH_65 1
77-#define AFTER_RH_66 1
78-#define BEFORE_RH_70 1
79-#define BEFORE_RH_71 1
80-#endif
81-#ifdef KERNELVERSION_3_10_0_123
82-#define AFTER_RH_62 1
83-#define AFTER_RH_63 1
84-#define AFTER_RH_64 1
85-#define AFTER_RH_65 1
86-#define AFTER_RH_66 1
87-#define AFTER_RH_67 1
88-#define AFTER_RH_6x 1
89-#define BEFORE_RH_71 1
90-#endif
91-#ifdef KERNELVERSION_3_10_0_229
92-#define AFTER_RH_62 1
93-#define AFTER_RH_63 1
94-#define AFTER_RH_64 1
95-#define AFTER_RH_65 1
96-#define AFTER_RH_66 1
97-#define AFTER_RH_67 1
98-#define AFTER_RH_6x 1
99-#define AFTER_RH_70 1
100-#define BEFORE_RH_72 1
101-#endif
102-#ifdef KERNELVERSION_3_10_0_327
103 #define AFTER_RH_62 1
104 #define AFTER_RH_63 1
105 #define AFTER_RH_64 1
106@@ -111,7 +35,6 @@
107 #define AFTER_RH_6x 1
108 #define AFTER_RH_70 1
109 #define AFTER_RH_72 1
110-#endif
111
112 /* Misc defines needed so source is same for all versions of Linux */
113 #ifndef SDEV_TRANSPORT_OFFLINE
114diff -ur lin_tape-3.0.8/sgmp.c lin_tape-3.0.8-norh/sgmp.c
115--- lin_tape-3.0.8/sgmp.c 2016-03-17 04:44:07.000000000 +0100
116+++ lin_tape-3.0.8-norh/sgmp.c 2016-06-19 09:55:40.075920922 +0200
117@@ -262,31 +262,11 @@
118 {
119 struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
120
121-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
122- /* RHEL 7.0 and beyond */
123 struct request_queue *q = sfp->parentdp->device->request_queue;
124-#else
125-#ifdef AFTER_RH_63
126- /* RHEL 6.4+ */
127- struct request_queue *q = sfp->parentdp->device->request_queue;
128-#endif
129-#endif
130-
131 if (sfp->parentdp->device->type == TYPE_SCANNER)
132 return 0;
133
134-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
135- /* RHEL 7.0 and beyond */
136- return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
137-#else
138-#ifdef AFTER_RH_63
139- /* RHEL 6.4+ */
140- return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
141-#else
142- /* RHEL6.3- or SLES11SP3 */
143 return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
144-#endif
145-#endif
146 }
147
148 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
149diff -ur lin_tape-3.0.8/upper.c lin_tape-3.0.8-norh/upper.c
150--- lin_tape-3.0.8/upper.c 2016-02-23 20:19:55.000000000 +0100
151+++ lin_tape-3.0.8-norh/upper.c 2016-06-19 09:56:18.759745753 +0200
152@@ -266,20 +266,7 @@
153 {
154 if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
155 return -EFAULT;
156-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
157- /* RHEL 7.0 and beyond */
158- if (blk_verify_command(q, pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
159-#else
160-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
161-#ifdef AFTER_RH_63
162- /* RHEL 6.4+ */
163- if (blk_verify_command(q, pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
164-#else
165- /* RHEL 6.3- or SLES11SP3 */
166 if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
167-#endif
168-#endif
169-#endif
170 return -EPERM;
171
172 /*
173--- lin_tape-3.0.8/sgmp.c~ 2016-06-19 13:18:16.000000000 +0200
174+++ lin_tape-3.0.8/sgmp.c 2016-06-19 13:21:28.375961483 +0200
175@@ -1544,7 +1544,7 @@
176 if ((sdp->sgdebug > 0) &&
177 ((CHECK_CONDITION == srp->header.masked_status) ||
178 (COMMAND_TERMINATED == srp->header.masked_status)))
179-#ifdef AFTER_RH_72
180+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
181 __scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
182
183 #else
184--- lin_tape-3.0.8/stmp.c~ 2016-06-19 13:18:16.000000000 +0200
185+++ lin_tape-3.0.8/stmp.c 2016-06-19 13:21:10.882407139 +0200
186@@ -467,7 +467,7 @@
187 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
188 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
189 if (cmdstatp->have_sense)
190-#ifdef AFTER_RH_72
191+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
192 __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
193
194 #else
195@@ -488,7 +488,7 @@
196 scode != VOLUME_OVERFLOW &&
197 SRpnt->cmd[0] != MODE_SENSE &&
198 SRpnt->cmd[0] != TEST_UNIT_READY) {
199-#ifdef AFTER_RH_72
200+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
201 __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
202
203 #else
This page took 0.046724 seconds and 4 git commands to generate.