]> git.pld-linux.org Git - packages/lin_tape.git/blob - linux-3.10.patch
- make kernel patch version independent
[packages/lin_tape.git] / linux-3.10.patch
1 diff -ur lin_tape-2.1.0/lin_tape_scsi_config.c lin_tape-2.1.0-3.10/lin_tape_scsi_config.c
2 --- lin_tape-2.1.0/lin_tape_scsi_config.c       2013-06-12 23:07:31.000000000 +0200
3 +++ lin_tape-2.1.0-3.10/lin_tape_scsi_config.c  2013-08-25 14:24:13.053537972 +0200
4 @@ -3150,6 +3150,31 @@
5         return;
6  } /* lin_tape_delete_tsm_pseudo() */
7  
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
9 +static int tape_proc_open(struct inode *inode, struct file *file)
10 +{
11 +       return single_open(file, tape_read_proc, PDE_DATA(inode));
12 +}
13 +
14 +static int changer_proc_open(struct inode *inode, struct file *file)
15 +{
16 +       return single_open(file, changer_read_proc, PDE_DATA(inode));
17 +}
18 +
19 +static const struct file_operations tape_proc_fops = {
20 +       .open           = tape_proc_open,
21 +       .read           = seq_read,
22 +       .llseek         = seq_lseek,
23 +       .release        = single_release,
24 +};
25 +
26 +static const struct file_operations changer_proc_fops = {
27 +       .open           = changer_proc_open,
28 +       .read           = seq_read,
29 +       .llseek         = seq_lseek,
30 +       .release        = single_release,
31 +};
32 +#endif
33  /*******************************************************************************
34  *                                                                              *
35  *  NAME: lin_tape_create_proc                                                  *
36 @@ -3167,42 +3191,56 @@
37         DbgPrint(("lin_tape: lin_tape_create_proc entry\n"));
38  
39         WRITE_LOCK(&lin_tape_lock);
40 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
41         if(!tape_proc_entry) {
42                 tape_proc_entry =
43                         create_proc_entry("scsi/IBMtape", 0, NULL);
44  
45                 if(!tape_proc_entry) {
46                         DbgPrint(("lin_tape: cannot initialize "\
47                                 "/proc/scsi/IBMtape\n"));
48                         goto EXIT_LABEL;
49                 } /* if */
50  
51                 tape_proc_entry->read_proc = tape_read_proc;
52  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
53                 tape_proc_entry->owner = THIS_MODULE;
54  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
55                 tape_proc_entry->get_info = NULL;
56  #endif
57  #endif
58 +#else
59 +       if (!proc_create("scsi/IBMtape", 0, NULL, &tape_proc_fops)) {
60 +               DbgPrint(("lin_tape: cannot initialize "\
61 +                       "/proc/scsi/IBMtape\n"));
62 +               goto EXIT_LABEL;
63 +#endif
64         } /* if */
65  
66 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
67         if(!changer_proc_entry) {
68                 changer_proc_entry =
69                         create_proc_entry("scsi/IBMchanger", 0, NULL);
70  
71                 if(!changer_proc_entry) {
72                         DbgPrint(("lin_tape: cannot initialize "\
73                                 "/proc/scsi/IBMchanger\n"));
74                         goto EXIT_LABEL;
75                 } /* if */
76  
77                 changer_proc_entry->read_proc = changer_read_proc;
78  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
79                 changer_proc_entry->owner = THIS_MODULE;
80  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
81                 changer_proc_entry->get_info = NULL;
82  #endif
83  #endif
84 +#else
85 +       if (!proc_create("scsi/IBMchanger", 0, NULL, &changer_proc_fops)) {
86 +               DbgPrint(("lin_tape: cannot initialize "\
87 +                       "/proc/scsi/IBMchanger\n"));
88 +               goto EXIT_LABEL;
89 +#endif
90         } /* if */
91  
92  EXIT_LABEL:
93 @@ -3229,15 +3227,20 @@
94  {
95         WRITE_LOCK(&lin_tape_lock);
96  
97 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
98         if(tape_proc_entry) {
99                 remove_proc_entry("scsi/IBMtape", NULL);
100                 tape_proc_entry = NULL;
101         } /* if */
102  
103         if(changer_proc_entry) {
104                 remove_proc_entry("scsi/IBMchanger", NULL);
105                 changer_proc_entry = NULL;
106         } /* if */
107 +#else
108 +       remove_proc_entry("scsi/IBMtape", NULL);
109 +       remove_proc_entry("scsi/IBMchanger", NULL);
110 +#endif
111  
112         WRITE_UNLOCK(&lin_tape_lock);
113  
114 @@ -3262,51 +3253,80 @@
115  *                                                                              *
116  *******************************************************************************/
117  
118 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
119  static int tape_read_proc(char* buffer, char** start, off_t offset, int length,
120         int* eof, void* data)
121 +#else
122 +static int tape_read_proc(struct seq_file *m, void* data)
123 +#endif
124  {
125 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
126         int buf_offset = 0, i = 0, start_dev = 0, found = 0, linelen = 0;
127         unchar* model = NULL, * pre_buf = NULL;
128         unchar temp_buf[96];
129 +#else
130 +       int i = 0, found = 0;
131 +       unchar* model = NULL;
132 +#endif
133         char* sn = NULL;
134         boolean tape_des_locked = False;
135  
136         DbgPrint(("lin_tape: tape_read_proc entry\n"));
137  
138         model = kmalloc(12, GFP_KERNEL);
139 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
140         pre_buf = kmalloc(ONE_K / 4, GFP_KERNEL);
141 +#endif
142         sn = kmalloc(MaxSerialNumberSize + 1, GFP_KERNEL);
143 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
144         if(!model || !pre_buf || !sn || !buffer || !start || !eof) {
145                 if(start) *start = buffer;
146                 if(eof) *eof = True;
147 +#else
148 +       if(!model || !sn) {
149 +#endif
150                 goto EXIT_LABEL;
151         } /* if */
152  
153 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
154         memset(temp_buf, '\0', 96);
155 +#endif
156         memset(model, '\0', 12);
157 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
158         memset(pre_buf, '\0', ONE_K / 4);
159 +#endif
160         memset(sn, '\0', MaxSerialNumberSize + 1);
161  
162         i = 0;
163  
164 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
165         if(!offset && rd_pc_initial(buffer, &buf_offset, length, start, False))
166                 goto EXIT_LABEL;
167  
168         if(rd_pc_start_dev(&start_dev, eof, offset, buffer, &buf_offset, False))
169                 goto EXIT_LABEL;
170 +#else
171 +       rd_pc_initial(m, False);
172 +#endif
173  
174         READ_LOCK(&tape_des_lock);
175         tape_des_locked = True;
176  
177         if(!tape_devs) {
178 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
179                 *eof = True;
180                 if(buf_offset == length) buf_offset--;
181                 buf_offset += sprintf(&buffer[buf_offset], "\n");
182                 *start = buffer;
183 +#endif
184                 goto EXIT_LABEL;
185         } /* if */
186  
187 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
188         for(i = start_dev; i < MaxLinTapeDevices; i++) {
189 +#else
190 +       for(i = 0; i < MaxLinTapeDevices; i++) {
191 +#endif
192                 if(!tape_devs[i] || !tape_devs[i]->dev_obj) continue;
193  
194                 found = False;
195 @@ -3326,8 +3301,12 @@
196                         sn[strlen(sn) - 1] == '\t'))
197                         sn[strlen(sn) - 1] = '\0';
198  
199 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
200                 linelen = snprintf(pre_buf, ONE_K / 4,
201                         "\n%-8d%-12s%-18s%-16s%-16s%-10s",
202 +#else
203 +               seq_printf(m, "%-8d%-12s%-18s%-16s",
204 +#endif
205                         i,
206                         model,
207  
208 @@ -3335,12 +3309,22 @@
209                         tape_devs[i]->serial_num_len ? sn : "NA",
210  
211                         tape_devs[i]->ghost_device ? "" :
212 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
213                         found ? tape_devs[i]->pname : "NA",
214 +#else
215 +                       found ? tape_devs[i]->pname : "NA");
216 +#endif
217  
218 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
219                         tape_devs[i]->ghost_device ? ""       :
220                         scsi_addr_str(tape_devs[i], temp_buf,
221                                 False),
222 +#else
223 +               if (!tape_devs[i]->ghost_device)
224 +                       scsi_addr_str(tape_devs[i], m, False);
225  
226 +               seq_printf(m, "%-10s\n",
227 +#endif
228                         tape_devs[i]->ghost_device ? ""       :
229                         !found ? "NA"                         :
230                         !tape_devs[i]->serial_num_len ? "NA"  :
231 @@ -3349,45 +3323,59 @@
232                         tape_devs[i]->isPrimary ? "Primary"   :
233                         "Alternate");
234  
235 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
236                 if(buf_offset > length) {
237                         buf_offset = length;
238                         break;
239                 } else if(buf_offset + linelen >= length) {
240                         memset(&buffer[buf_offset], ' ', length - buf_offset);
241                         buf_offset = length;
242                         break;
243                 } /* if */
244  
245                 buf_offset += sprintf(&buffer[buf_offset], "%s", pre_buf);
246 +#endif
247                 tape_devs[i]->proc_read = True;
248         } /* for */
249  
250         tape_des_locked = False;
251         READ_UNLOCK(&tape_des_lock);
252  
253 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
254         if(i == start_dev || i >= MaxLinTapeDevices) {
255                 if(buf_offset == length) buf_offset--;
256                 buf_offset += sprintf(&buffer[buf_offset], "\n");
257                 *eof = True;
258                 if(i >= MaxLinTapeDevices) *start = buffer;
259                 goto EXIT_LABEL;
260         } /* if */
261  
262         *start = buffer;
263 +#endif
264  
265  EXIT_LABEL:
266  
267 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
268         if(pre_buf) kfree(pre_buf);
269 +#endif
270         if(model) kfree(model);
271         if(sn) kfree(sn);
272  
273         if(tape_des_locked) READ_UNLOCK(&tape_des_lock);
274         tape_des_locked = False;
275  
276 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
277         if(buf_offset == 1 && *eof) buf_offset = 0;
278         DbgPrint(("tape_read_proc exit: %d\n", buf_offset));
279 +#else
280 +       DbgPrint(("tape_read_proc exit:\n"));
281 +#endif
282  
283 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
284         return buf_offset;
285 +#else
286 +       return 0;
287 +#endif
288  } /* tape_read_proc() */
289  
290  /*******************************************************************************
291 @@ -3409,12 +3361,21 @@
292  *                                                                              *
293  *******************************************************************************/
294  
295 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
296  static int changer_read_proc(char* buffer, char** start, off_t offset,
297                                 int length, int* eof, void* data)
298 +#else
299 +static int changer_read_proc(struct seq_file *m, void* data)
300 +#endif
301  {
302 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
303         int buf_offset = 0, i = 0, start_dev = 0, found = 0, linelen = 0;
304         unchar* model = NULL, * pre_buf = NULL;
305         unchar temp_buf[96];
306 +#else
307 +       int i = 0, found = 0;
308 +       unchar* model = NULL;
309 +#endif
310         char* sn = NULL;
311         boolean changer_des_locked = False;
312  
313 @@ -3423,37 +3373,57 @@
314         i = 0;
315  
316         model = kmalloc(12, GFP_KERNEL);
317 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
318         pre_buf = kmalloc(ONE_K / 4, GFP_KERNEL);
319 +#endif
320         sn = kmalloc(MaxSerialNumberSize + 1, GFP_KERNEL);
321 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
322         if(!model || !pre_buf || !sn || !buffer || !start || !eof) {
323                 if(start) *start = buffer;
324                 if(eof) *eof = True;
325 +#else
326 +       if(!model || !sn) {
327 +#endif
328                 goto EXIT_LABEL;
329         } /* if */
330  
331 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
332         memset(temp_buf, '\0', 96);
333 +#endif
334         memset(model, '\0', 12);
335 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
336         memset(pre_buf, '\0', ONE_K / 4);
337 +#endif
338         memset(sn, '\0', MaxSerialNumberSize + 1);
339  
340 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
341         if(!offset && rd_pc_initial(buffer, &buf_offset, length, start, True))
342                 goto EXIT_LABEL;
343  
344         if(rd_pc_start_dev(&start_dev, eof, offset, buffer, &buf_offset, True))
345                 goto EXIT_LABEL;
346 +#else
347 +       rd_pc_initial(m, True);
348 +#endif
349  
350         READ_LOCK(&changer_des_lock);
351         changer_des_locked = True;
352  
353         if(!changer_devs) {
354 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
355                 *eof = True;
356                 if(buf_offset == length) buf_offset--;
357                 buf_offset += sprintf(&buffer[buf_offset], "\n");
358                 *start = buffer;
359 +#endif
360                 goto EXIT_LABEL;
361         } /* if */
362  
363 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
364         for(i = start_dev; i < MaxLinTapeChangerDevices; i++) {
365 +#else
366 +       for(i = 0; i < MaxLinTapeChangerDevices; i++) {
367 +#endif
368                 if(!changer_devs[i] || !changer_devs[i]->dev_obj) continue;
369  
370                 found = False;
371 @@ -3472,8 +3409,12 @@
372                         sn[strlen(sn) - 1] == '\t'))
373                         sn[strlen(sn) - 1] = '\0';
374  
375 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
376                 linelen = snprintf(pre_buf, ONE_K / 4,
377                         "\n%-8d%-12s%-18s%-16s%-16s%-10s",
378 +#else
379 +               seq_printf(m, "%-8d%-12s%-18s%-16s",
380 +#endif
381                         i,
382                         model,
383  
384 @@ -3481,14 +3417,24 @@
385                         changer_devs[i]->serial_num_len ? sn : "NA",
386  
387                         changer_devs[i]->ghost_device ? "" :
388 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
389                         found ? changer_devs[i]->pname : "NA",
390 +#else
391 +                       found ? changer_devs[i]->pname : "NA");
392 +#endif
393  
394 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
395                         changer_devs[i]->ghost_device ? ""       :
396                         scsi_addr_str((struct tape_descriptor*)
397                                 changer_devs[i],
398                                 temp_buf,
399                                 True),
400 +#else
401 +               if (!changer_devs[i]->ghost_device)
402 +                       scsi_addr_str((struct tape_descriptor*)changer_devs[i], m, True);
403  
404 +               seq_printf(m, "%-10s\n",
405 +#endif
406                         changer_devs[i]->ghost_device                 ? ""   :
407                         !found                                        ? "NA" :
408                         changer_devs[i]->chg_id == IBM_3590
409 @@ -3498,45 +3432,59 @@
410                         changer_devs[i]->isPrimary            ? "Primary"     :
411                         "Alternate");
412  
413 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
414                 if(buf_offset > length) {
415                         buf_offset = length;
416                         break;
417                 } else if(buf_offset + linelen >= length) {
418                         memset(&buffer[buf_offset], ' ', length - buf_offset);
419                         buf_offset = length;
420                         break;
421                 } /* if */
422  
423                 buf_offset += sprintf(&buffer[buf_offset], "%s", pre_buf);
424 +#endif
425                 changer_devs[i]->proc_read = True;
426         } /* for */
427  
428         changer_des_locked = False;
429         READ_UNLOCK(&changer_des_lock);
430  
431 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
432         if(i == start_dev || i >= MaxLinTapeChangerDevices) {
433                 if(buf_offset == length) buf_offset--;
434                 buf_offset += sprintf(&buffer[buf_offset], "\n");
435                 *eof = True;
436                 if(i >= MaxLinTapeChangerDevices) *start = buffer;
437                 goto EXIT_LABEL;
438         } /* if */
439  
440         *start = buffer;
441 +#endif
442  
443  EXIT_LABEL:
444  
445         if(model) kfree(model);
446 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
447         if(pre_buf) kfree(pre_buf);
448 +#endif
449         if(sn) kfree(sn);
450  
451         if(changer_des_locked) READ_UNLOCK(&changer_des_lock);
452         changer_des_locked = False;
453  
454 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
455         if(buf_offset == 1 && *eof) buf_offset = 0;
456         DbgPrint(("changer_read_proc exit: %d\n", buf_offset));
457 +#else
458 +       DbgPrint(("changer_read_proc exit\n"));
459 +#endif
460  
461 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
462         return buf_offset;
463 +#else
464 +       return 0;
465 +#endif
466  } /* changer_read_proc() */
467  
468  /*******************************************************************************
469 @@ -3557,15 +3469,25 @@
470  *                                                                              *
471  *******************************************************************************/
472  
473 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
474  int rd_pc_initial(char* buffer, int* buf_offset, int length, char** start,
475         boolean chg)
476 +#else
477 +int rd_pc_initial(struct seq_file *m, boolean chg)
478 +#endif
479  {
480 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
481         int rc = 1, count = 0, i = 0, max_devices = 0;
482         char tmp_buf[96];
483 +#else
484 +       int i = 0, max_devices = 0;
485 +#endif
486  
487         DbgPrint(("rd_pc_initial entry\n"));
488  
489 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
490         memset(tmp_buf, '\0', 96);
491 +#endif
492         max_devices = chg ? MaxLinTapeChangerDevices : MaxLinTapeDevices;
493  
494         /* set proc_read flag for each logical device to false */
495 @@ -3580,47 +3489,59 @@
496         } /* if */
497         WRITE_UNLOCK(chg ? &changer_des_lock : &tape_des_lock);
498  
499 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
500         count = sprintf(tmp_buf, "lin_tape version: %s", LIN_TAPE_VERSION);
501         if(count > length) goto EXIT_LABEL;
502  
503         count = sprintf(buffer, "lin_tape version: %s", LIN_TAPE_VERSION);
504         *buf_offset = count;
505  
506         count = sprintf(tmp_buf, "\nlin_tape major number: %d", lin_tape_major);
507         if(*buf_offset + count > length) goto EXIT_LABEL;
508  
509         count = sprintf(buffer + *buf_offset,
510                 "\nlin_tape major number: %d", lin_tape_major);
511         *buf_offset += count;
512  
513         count = sprintf(tmp_buf, "\nAttached %s Devices:",
514                 chg ? "Changer" : "Tape");
515         if(*buf_offset + count > length) goto EXIT_LABEL;
516  
517         count = sprintf(buffer + *buf_offset, "\nAttached %s Devices:",
518                 chg ? "Changer" : "Tape");
519         *buf_offset += count;
520  
521         count = sprintf(tmp_buf, "\n%-8s%-12s%-18s%-16s%-16s%-10s",
522                         "Number", "model", "SN", "HBA", "SCSI", "FO Path");
523         if(*buf_offset + count > length) goto EXIT_LABEL;
524  
525         count = sprintf(buffer + *buf_offset, "\n%-8s%-12s%-18s%-16s%-16s%-10s",
526 +#else
527 +       seq_printf(m, "lin_tape version: %s\n", LIN_TAPE_VERSION);
528 +       seq_printf(m, "lin_tape major number: %d\n", lin_tape_major);
529 +       seq_printf(m, "Attached %s Devices:\n", chg ? "Changer" : "Tape");
530 +       seq_printf(m, "%-8s%-12s%-18s%-16s%-16s%-10s\n",
531 +#endif
532                 "Number", "model", "SN", "HBA", "SCSI", "FO Path");
533 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
534         *buf_offset += count;
535  
536         rc = 0;
537  
538  EXIT_LABEL:
539  
540         if(rc) {
541                 memset(buffer + *buf_offset, ' ', length - *buf_offset);
542                 *buf_offset = length;
543                 *start = buffer;
544         } /* if */
545  
546         DbgPrint(("rd_pc_initial  exit: %d\n", rc));
547         return rc;
548 +#else
549 +       DbgPrint(("rd_pc_initial exit\n"));
550 +       return 0;
551 +#endif
552  } /* rd_pc_initial() */
553  
554  /*******************************************************************************
555 @@ -3642,8 +3518,13 @@
556  *                                                                              *
557  *******************************************************************************/
558  
559 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
560  int rd_pc_start_dev(int* start_dev, int* eof, off_t offset, char* buffer,
561         int* buf_offset, boolean chg)
562 +#else
563 +int rd_pc_start_dev(int* start_dev, int* eof, off_t offset, struct seq_file *m,
564 +       boolean chg)
565 +#endif
566  {
567         int found = False, rc = 0, i = 0, max_devices = 0;
568  
569 @@ -3678,7 +3554,11 @@
570  
571         if(*start_dev >= max_devices) {
572                 *eof = True;
573 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
574                 *buf_offset += sprintf(&buffer[*buf_offset], "\n");
575 +#else
576 +               seq_printf(m, "\n");
577 +#endif
578                 rc = 1;
579                 goto EXIT_LABEL;
580         } /* if */
581 @@ -3705,17 +3581,31 @@
582  *                                                                              *
583  *******************************************************************************/
584  
585 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
586  char* scsi_addr_str(struct tape_descriptor* drv, char* buffer, boolean cgr)
587 +#else
588 +void scsi_addr_str(struct tape_descriptor* drv, struct seq_file *m, boolean cgr)
589 +#endif
590  {
591         struct changer_descriptor* chg = (struct changer_descriptor*)drv;
592  
593         if(cgr)
594 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
595                 sprintf(buffer, "%d:%d:%d:%d",
596 +#else
597 +               seq_printf(m, "%d:%d:%d:%d",
598 +#endif
599                         chg->host, chg->channel, chg->target, chg->lun);
600         else
601 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
602                 sprintf(buffer, "%d:%d:%d:%d",
603 +#else
604 +               seq_printf(m, "%d:%d:%d:%d",
605 +#endif
606                         drv->host, drv->channel, drv->target, drv->lun);
607 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
608         return buffer;
609 +#endif
610  } /* scsi_addr_str() */
611  
612  /*******************************************************************************
613 diff -ur lin_tape-2.1.0/lin_tape_scsi_config.h lin_tape-2.1.0-3.10/lin_tape_scsi_config.h
614 --- lin_tape-2.1.0/lin_tape_scsi_config.h       2013-06-12 23:07:31.000000000 +0200
615 +++ lin_tape-2.1.0-3.10/lin_tape_scsi_config.h  2013-08-25 14:22:14.635373745 +0200
616 @@ -178,14 +178,24 @@
617  #endif
618  static void lin_tape_rescan(struct device *);
619  
620 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
621  static int tape_read_proc(char *, char **, off_t, int, int *, void *);
622  int rd_pc_initial(char* buffer, int* buf_offset, int length, char** start,
623         boolean chg);
624  int rd_pc_start_dev(int* start_dev, int* eof, off_t offset, char* buffer,
625         int* buf_offset, boolean chg);
626  char* scsi_addr_str(struct tape_descriptor* drv, char* buffer, boolean cgr);
627 +#else
628 +static int tape_read_proc(struct seq_file *, void *);
629 +int rd_pc_initial(struct seq_file *, boolean chg);
630 +void scsi_addr_str(struct tape_descriptor* drv, struct seq_file *m, boolean cgr);
631 +#endif
632  
633 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
634  static int changer_read_proc(char *, char **, off_t, int, int *, void *);
635 +#else
636 +static int changer_read_proc(struct seq_file *, void *);
637 +#endif
638  
639  /* global variables */
640  static unchar lin_tape_cleanup_module = 0;
641 @@ -222,8 +219,10 @@
642  atomic_t tsm_tp_open = {0};
643  static unsigned int lin_tape_major;
644  
645 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
646  static struct proc_dir_entry *tape_proc_entry = NULL;
647  static struct proc_dir_entry *changer_proc_entry = NULL;
648 +#endif
649  
650  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
651  rwlock_t hba_lock = RW_LOCK_UNLOCKED;
This page took 0.077342 seconds and 4 git commands to generate.