]> git.pld-linux.org Git - packages/lin_tape.git/blob - clean-ifdefs.patch
- started update to 3.0.18
[packages/lin_tape.git] / clean-ifdefs.patch
1 diff -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 @@
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 uname -r 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  ifeq ($(SFMP), 1)
18  EXTRA_CFLAGS += -DSFMPENABLED
19  endif
20 diff -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
23 @@ -26,97 +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 -#define BEFORE_RH_72 1
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
45 -#define BEFORE_RH_72 1
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
54 -#define BEFORE_RH_72 1
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
64 -#define BEFORE_RH_72 1
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
74 -#define BEFORE_RH_72 1
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
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
92 -#define BEFORE_RH_70 1
93 -#define BEFORE_RH_71 1
94 -#define BEFORE_RH_72 1
95 -#endif
96 -#ifdef KERNELVERSION_3_10_0_123
97 -#define AFTER_RH_62 1
98 -#define AFTER_RH_63 1
99 -#define AFTER_RH_64 1
100 -#define AFTER_RH_65 1
101 -#define AFTER_RH_66 1
102 -#define AFTER_RH_67 1
103 -#define AFTER_RH_6x 1
104 -#define BEFORE_RH_71 1
105 -#endif
106 -#ifdef KERNELVERSION_3_10_0_229
107 -#define AFTER_RH_62 1
108 -#define AFTER_RH_63 1
109 -#define AFTER_RH_64 1
110 -#define AFTER_RH_65 1
111 -#define AFTER_RH_66 1
112 -#define AFTER_RH_67 1
113 -#define AFTER_RH_6x 1
114 -#define AFTER_RH_70 1
115 -#define BEFORE_RH_72 1
116 -#endif
117 -#ifdef KERNELVERSION_3_10_0_327
118  #define AFTER_RH_62 1
119  #define AFTER_RH_63 1
120  #define AFTER_RH_64 1
121 @@ -126,7 +35,6 @@
122  #define AFTER_RH_6x 1
123  #define AFTER_RH_70 1
124  #define AFTER_RH_71 1
125 -#endif
126  
127  /* Misc defines needed so source is same for all versions of Linux */
128  #ifndef SDEV_TRANSPORT_OFFLINE
129 diff -ur lin_tape-3.0.18/sgmp.c lin_tape-3.0.18-ifdefs/sgmp.c
130 --- lin_tape-3.0.18/sgmp.c      2017-02-23 19:14:41.000000000 +0100
131 +++ lin_tape-3.0.18-ifdefs/sgmp.c       2017-05-09 21:10:20.295643954 +0200
132 @@ -262,27 +262,12 @@
133  {
134         struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
135  
136 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
137 -       /* RHEL 7.0 and beyond */
138         struct request_queue *q = sfp->parentdp->device->request_queue;
139 -#else
140 -#ifdef AFTER_RH_63
141 -       /* RHEL 6.4+ */
142 -       struct request_queue *q = sfp->parentdp->device->request_queue;
143 -#endif
144 -#endif
145  
146         if (sfp->parentdp->device->type == TYPE_SCANNER)
147                 return 0;
148  
149 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
150         return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
151 -#else
152 -       /* RHEL 6.4 and beyond */
153 -       return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
154 -#endif
155 -//6.3 blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
156 -
157  }
158  
159  #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
160 @@ -419,7 +404,7 @@
161  #endif
162                 sdp->sgdebug = 0;
163                 q = sdp->device->request_queue;
164 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
165 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
166                 sdp->sg_tablesize = min(queue_max_hw_segments(q),
167                                  queue_max_phys_segments(q));
168  #else
169 @@ -1546,7 +1531,7 @@
170                 if ((sdp->sgdebug > 0) &&
171                     ((CHECK_CONDITION == srp->header.masked_status) ||
172                      (COMMAND_TERMINATED == srp->header.masked_status)))
173 -#ifdef AFTER_RH_71
174 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
175                         __scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
176  
177  #else
178 @@ -1677,7 +1662,7 @@
179         INIT_LIST_HEAD(&sdp->sfds);
180         init_waitqueue_head(&sdp->o_excl_wait);
181  
182 -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32) && (defined(SLESVERSION))
183 +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
184         sdp->sg_tablesize = min(queue_max_hw_segments(q),
185                              queue_max_phys_segments(q));
186  #else
187 @@ -3069,7 +3054,7 @@
188                               scsidp->id, scsidp->lun, (int) scsidp->type,
189                               1,
190                               (int) scsidp->queue_depth,
191 -#ifdef AFTER_RH_71
192 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
193                                   (int) atomic_read(&scsidp->device_busy),
194  #else
195                                   (int) scsidp->device_busy,
196 diff -ur lin_tape-3.0.18/stmp.c lin_tape-3.0.18-ifdefs/stmp.c
197 --- lin_tape-3.0.18/stmp.c      2017-02-23 19:14:41.000000000 +0100
198 +++ lin_tape-3.0.18-ifdefs/stmp.c       2017-05-09 21:11:01.113125428 +0200
199 @@ -454,7 +454,7 @@
200                        SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
201                        SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
202                 if (cmdstatp->have_sense)
203 -#ifdef AFTER_RH_70
204 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
205                         __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
206  
207  #else
208 @@ -475,7 +475,7 @@
209                          scode != VOLUME_OVERFLOW &&
210                          SRpnt->cmd[0] != MODE_SENSE &&
211                          SRpnt->cmd[0] != TEST_UNIT_READY) {
212 -#ifdef AFTER_RH_71
213 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
214                         __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
215  
216  #else
217 diff -ur lin_tape-3.0.18/upper.c lin_tape-3.0.18-ifdefs/upper.c
218 --- lin_tape-3.0.18/upper.c     2017-02-23 19:14:41.000000000 +0100
219 +++ lin_tape-3.0.18-ifdefs/upper.c      2017-05-09 21:09:37.868126006 +0200
220 @@ -267,7 +267,7 @@
221         if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
222                 return -EFAULT;
223  
224 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
225 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
226         if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
227  #else
228         /* RHEL 6.4 and beyond */
229 @@ -608,7 +608,7 @@
230         if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
231                 goto error;
232  
233 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) || defined(SLESVERSION)
234 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
235         err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE);
236  #else
237         /* RHEL 6.4 and beyond */
This page took 0.06601 seconds and 3 git commands to generate.