]> git.pld-linux.org Git - packages/lin_tape.git/blob - kernel-5.6.patch
651d11e694cd6a4f99692210dc90a2cc5c743e63
[packages/lin_tape.git] / kernel-5.6.patch
1 --- lin_tape-3.0.52/lin_tape_scsi_config.h~     2020-03-05 19:43:09.000000000 +0100
2 +++ lin_tape-3.0.52/lin_tape_scsi_config.h      2020-04-04 21:53:09.046695460 +0200
3 @@ -223,6 +223,7 @@
4  {
5         return single_open(file, tape_read_proc, NULL);
6  }
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
8  static struct file_operations tape_proc_ops = {
9      .owner   = THIS_MODULE,
10      .open    = tape_open_proc,
11 @@ -230,6 +231,14 @@
12      .llseek  = seq_lseek,
13      .release = single_release,
14  };
15 +#else
16 +static struct proc_ops tape_proc_ops = {
17 +    .proc_open    = tape_open_proc,
18 +    .proc_read    = seq_read,
19 +    .proc_lseek  = seq_lseek,
20 +    .proc_release = single_release,
21 +};
22 +#endif
23  #endif
24  
25  int rd_pc_initial
26 @@ -255,6 +264,7 @@
27  {
28         return single_open(file, changer_read_proc, NULL);
29  }
30 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
31  static struct file_operations changer_proc_ops = {
32      .owner   = THIS_MODULE,
33      .open    = changer_open_proc,
34 @@ -262,6 +272,14 @@
35      .llseek  = seq_lseek,
36      .release = single_release,
37  };
38 +#else
39 +static struct proc_ops changer_proc_ops = {
40 +    .proc_open    = changer_open_proc,
41 +    .proc_read    = seq_read,
42 +    .proc_lseek  = seq_lseek,
43 +    .proc_release = single_release,
44 +};
45 +#endif
46  #endif
47  
48  static int status_read_proc
49 @@ -273,6 +291,7 @@
50  {
51         return single_open(file, status_read_proc, NULL);
52  }
53 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
54  static struct file_operations status_proc_ops = {
55      .owner   = THIS_MODULE,
56      .open    = status_open_proc,
57 @@ -280,6 +299,14 @@
58      .llseek  = seq_lseek,
59      .release = single_release,
60  };
61 +#else
62 +static struct proc_ops status_proc_ops = {
63 +    .proc_open    = status_open_proc,
64 +    .proc_read    = seq_read,
65 +    .proc_lseek  = seq_lseek,
66 +    .proc_release = single_release,
67 +};
68 +#endif
69  #endif
70  
71  int rdstatus_pc_initial
72 --- lin_tape-3.0.52/lin_tape_ioctl_tape.c~      2020-03-05 19:43:09.000000000 +0100
73 +++ lin_tape-3.0.52/lin_tape_ioctl_tape.c       2020-04-04 22:13:44.016713929 +0200
74 @@ -25,6 +25,16 @@
75  #include "lin_tape_scsi_tape.h"
76  #include <linux/delay.h>
77  
78 +
79 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
80 +struct lin_tape_timeval {
81 +  __kernel_long_t      tv_sec;
82 +  __kernel_suseconds_t tv_usec;
83 +};
84 +#else
85 +#define lin_tape_timeval timeval
86 +#endif
87 +
88  /*****************************************************************************
89   *                                                                           *
90   *              Tape Drive Ioctls                                            *
91 @@ -2794,7 +2804,7 @@
92  
93  ssize_t tape_set_tod(struct tape_descriptor** drvp)
94  {
95 -       struct timeval* tv = NULL;
96 +       struct lin_tape_timeval* tv = NULL;
97         struct tod_control* buffer = NULL;
98         struct tape_descriptor *drv = *drvp;
99         int now = 0, rc = STATUS_SUCCESS;
100 @@ -2810,20 +2820,20 @@
101                 goto EXIT_LABEL;
102         } /* if */
103  
104 -       tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
105 +       tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
106         if(!tv) {
107                 rc = -ENOMEM;
108                 goto EXIT_LABEL;
109         } /* if */
110  
111         memset(buffer, '\0', sizeof(struct tod_control));
112 -       memset(tv, '\0', sizeof(struct timeval));
113 +       memset(tv, '\0', sizeof(struct lin_tape_timeval));
114  
115         rc = tape_modesense_page(&drv, TODControlPageNumber, (unchar*)buffer,
116                 sizeof(struct tod_control), True, True);
117         if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
118  
119 -       memset(tv, '\0', sizeof(struct timeval));
120 +       memset(tv, '\0', sizeof(struct lin_tape_timeval));
121  #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
122         do_gettimeofday(tv);
123  #else
124 @@ -8930,7 +8940,7 @@
125  
126  int erp_tod(struct tape_descriptor* drv, union cdb* tmp_cdb, char* sense_data)
127  {
128 -       struct timeval* tv = NULL;
129 +       struct lin_tape_timeval* tv = NULL;
130         struct tod_control* tod_buf = NULL;
131         int now = 0, rc = -EIO;
132  
133 @@ -8940,7 +8950,7 @@
134                 goto EXIT_LABEL;
135         } /* if */
136  
137 -       tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
138 +       tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
139         if(!tv) {
140                 rc = -ENOMEM;
141                 goto EXIT_LABEL;
142 @@ -8951,7 +8961,7 @@
143         if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
144  
145         /* get time info to set TOD */
146 -       memset(tv, '\0', sizeof(struct timeval));
147 +       memset(tv, '\0', sizeof(struct lin_tape_timeval));
148  #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
149         do_gettimeofday(tv);
150  #else
This page took 0.029085 seconds and 2 git commands to generate.