]> git.pld-linux.org Git - packages/lin_tape.git/blob - kernel-4.14.patch
00ee88581394b59251a75d0f4059aac91a96e7e8
[packages/lin_tape.git] / kernel-4.14.patch
1 --- lin_tape-3.0.20/fo_util.c~  2017-05-27 21:22:52.000000000 +0200
2 +++ lin_tape-3.0.20/fo_util.c   2017-11-17 09:04:43.375810976 +0100
3 @@ -169,7 +169,7 @@
4  
5  /** Enable the change of the debug control flag.
6   *  /sys/bus/scsi/drivers/pfo/debug_flag */
7 -static ssize_t pfoattr_debug_flag_set(struct device_driver *dev,
8 +static ssize_t debug_flag_store(struct device_driver *dev,
9                                         const char *buf, size_t count)
10  {
11         sscanf(buf, "0x%x", &pfo_debug_flag);
12 @@ -179,19 +179,18 @@
13  
14  /** Enable the cat of the debug control flag.
15   *  /sys/bus/scsi/drivers/pfo/debug_flag */
16 -static ssize_t pfoattr_debug_flag_get(struct device_driver *ddp, char *buf)
17 +static ssize_t debug_flag_show(struct device_driver *ddp, char *buf)
18  {
19         DBG_DEBUG("");
20         return scnprintf(buf, PAGE_SIZE,
21                 "debug flag=%04x\necho 0x<hexvalue> > debug_flag to change\n",
22                 pfo_debug_flag);
23  }
24 -static DRIVER_ATTR(debug_flag, S_IRUGO|S_IWUSR|S_IWGRP,
25 -                       pfoattr_debug_flag_get, pfoattr_debug_flag_set);
26 +static DRIVER_ATTR_RW(debug_flag);
27  
28  /** Enable the cat of the debug buffer.
29   *  /sys/bus/scsi/drivers/pfo/debug_buffer */
30 -static ssize_t pfoattr_debug_buffer_get(struct device_driver *ddp, char *buf)
31 +static ssize_t debug_buffer_show(struct device_driver *ddp, char *buf)
32  {
33         DBG_DEBUG("");
34         if (debug_buffer[0] == '\001') {
35 @@ -202,11 +201,11 @@
36                 return strlen(buf);
37         }
38  }
39 -static DRIVER_ATTR(debug_buffer, S_IRUGO, pfoattr_debug_buffer_get, NULL);
40 +static DRIVER_ATTR_RO(debug_buffer);
41  
42  /** Enable the cat of the trace buffer.
43   *  /sys/bus/scsi/drivers/pfo/trace */
44 -static ssize_t pfoattr_debug_trace_get(struct device_driver *ddp, char *buf)
45 +static ssize_t trace_show(struct device_driver *ddp, char *buf)
46  {
47         char *the_buffer;
48         int strlenbuf = 0;
49 @@ -232,7 +231,7 @@
50         }
51         return strlenbuf;
52  }
53 -static DRIVER_ATTR(trace, S_IRUGO, pfoattr_debug_trace_get, NULL);
54 +static DRIVER_ATTR_RO(trace);
55  
56  int init_debug(struct device_driver *pfo_gendrv)
57  {
58 --- lin_tape-3.0.20/intercept.c~        2017-11-18 09:30:20.000000000 +0100
59 +++ lin_tape-3.0.20/intercept.c 2017-11-18 09:32:26.165820320 +0100
60 @@ -299,7 +299,7 @@
61  /** Perform the operations the customer has requested when they wrote to
62   * /sys/bus/scsi/drivers/pfo/ctrl
63   */
64 -static ssize_t pfoattr_ctrl_set(struct device_driver *dev, const char *buf,
65 +static ssize_t ctrl_store(struct device_driver *dev, const char *buf,
66                                 size_t count)
67  {
68         intercept_ctrl(NULL, buf, count);
69 @@ -310,23 +310,22 @@
70   * /sys/bus/scsi/drivers/pfo/ctrl
71   * @return string length
72   */
73 -static ssize_t pfoattr_ctrl_get(struct device_driver *ddp, char *buf)
74 +static ssize_t ctrl_show(struct device_driver *ddp, char *buf)
75  {
76         return resolve_ctrl_get(buf, PAGE_SIZE);
77  }
78 -static DRIVER_ATTR(ctrl, S_IRUGO|S_IWUSR|S_IWGRP, pfoattr_ctrl_get,
79 -                               pfoattr_ctrl_set);
80 +static DRIVER_ATTR_RW(ctrl);
81  
82  
83  /** Create the text the customer will see when they read
84   * /sys/bus/scsi/drivers/pfo/version
85   * @return string length
86   */
87 -static ssize_t pfo_version_show(struct device_driver *ddd, char *buf)
88 +static ssize_t version_show(struct device_driver *ddd, char *buf)
89  {
90         return snprintf(buf, PAGE_SIZE, "[%s]\n", PFO_DATE_STR);
91  }
92 -static DRIVER_ATTR(version, S_IRUGO, pfo_version_show, NULL);
93 +static DRIVER_ATTR_RO(version);
94  
95  static ssize_t devattr_vendor(struct device *dev,
96                                 struct device_attribute *attr, char *buf)
97 --- lin_tape-3.0.20/lin_tape_scsi_config.c~     2017-05-27 21:22:51.000000000 +0200
98 +++ lin_tape-3.0.20/lin_tape_scsi_config.c      2017-11-18 09:36:47.106483198 +0100
99 @@ -47,7 +47,7 @@
100  *                                                                              *
101  *******************************************************************************/
102  
103 -static ssize_t tape_version_show(struct device_driver* driver, char* buf)
104 +static ssize_t version_show(struct device_driver* driver, char* buf)
105  {
106         int rc;
107  
108 @@ -57,7 +57,7 @@
109         return rc;
110  } /* tape_version_show() */
111  
112 -DRIVER_ATTR(version, 0444, tape_version_show, NULL);
113 +DRIVER_ATTR_RO(version);
114  
115  /*******************************************************************************
116  *                                                                              *
117 @@ -112,7 +112,7 @@
118  
119  } /* lin_tape_debug_store() */
120  
121 -DRIVER_ATTR(lin_tape_debug, 0660, lin_tape_debug_show, lin_tape_debug_store);
122 +DRIVER_ATTR_RW(lin_tape_debug);
123  
124  /*******************************************************************************
125  *                                                                              *
126 @@ -167,7 +167,7 @@
127  
128  } /* auto_logging_store() */
129  
130 -DRIVER_ATTR(auto_logging, 0660, auto_logging_show, auto_logging_store);
131 +DRIVER_ATTR_RW(auto_logging);
132  
133  /*******************************************************************************
134  *                                                                              *
135 @@ -221,7 +221,7 @@
136  
137  } /* petro_store() */
138  
139 -DRIVER_ATTR(petro, 0660, petro_show, petro_store);
140 +DRIVER_ATTR_RW(petro);
141  
142  /*******************************************************************************
143  *                                                                              *
144 @@ -276,7 +276,7 @@
145  
146  } /* support_dio_store() */
147  
148 -DRIVER_ATTR(support_dio, 0660, support_dio_show, support_dio_store);
149 +DRIVER_ATTR_RW(support_dio);
150  
151  /*******************************************************************************
152  *                                                                              *
153 @@ -303,7 +303,7 @@
154         return rc;
155  } /* wait_on_config_show() */
156  
157 -DRIVER_ATTR(wait_on_config, 0444, wait_on_config_show, NULL);
158 +DRIVER_ATTR_RO(wait_on_config);
159  
160  /*******************************************************************************
161  *                                                                              *
162 @@ -357,8 +357,7 @@
163         return count;
164  } /* changer_open_reserve_show() */
165  
166 -DRIVER_ATTR(changer_open_reserve, 0660, changer_open_reserve_show,
167 -       changer_open_reserve_store);
168 +DRIVER_ATTR_RW(changer_open_reserve);
169  
170  /*******************************************************************************
171  *                                                                              *
172 @@ -412,9 +411,7 @@
173         return count;
174  } /* default_sys_encryption_proxy_store() */
175  
176 -DRIVER_ATTR(default_sys_encryption_proxy, 0644,
177 -               default_sys_encryption_proxy_show,
178 -               default_sys_encryption_proxy_store);
179 +DRIVER_ATTR_RW(default_sys_encryption_proxy);
180  
181  /*******************************************************************************
182  *                                                                              *
183 @@ -470,9 +467,7 @@
184         return count;
185  } /* default_sys_encryption_write_show() */
186  
187 -DRIVER_ATTR(default_sys_encryption_write, 0644,
188 -               default_sys_encryption_write_show,
189 -               default_sys_encryption_write_store);
190 +DRIVER_ATTR_RW(default_sys_encryption_write);
191  
192  /*******************************************************************************
193  *                                                                              *
194 @@ -528,8 +523,7 @@
195  
196  } /* disable_density_on_open_store() */
197  
198 -DRIVER_ATTR(disable_density_on_open, 0660, disable_density_on_open_show,
199 -       disable_density_on_open_store);
200 +DRIVER_ATTR_RW(disable_density_on_open);
201  
202  /*******************************************************************************
203  *                                                                              *
204 @@ -584,8 +578,7 @@
205  
206  } /* dynamic_attributes_store() */
207  
208 -DRIVER_ATTR(dynamic_attributes, 0660, dynamic_attributes_show,
209 -       dynamic_attributes_store);
210 +DRIVER_ATTR_RW(dynamic_attributes);
211  
212  /*******************************************************************************
213  *                                                                              *
214 @@ -640,7 +633,7 @@
215  
216  } /* disable_auto_drive_dump_store() */
217  
218 -DRIVER_ATTR(disable_auto_drive_dump, 0660, disable_auto_drive_dump_show, disable_auto_drive_dump_store);
219 +DRIVER_ATTR_RW(disable_auto_drive_dump);
220  
221  /*******************************************************************************
222  *                                                                              *
223 @@ -695,7 +688,7 @@
224  
225  } /* busy_retry_store() */
226  
227 -DRIVER_ATTR(busy_retry, 0660, busy_retry_show, busy_retry_store);
228 +DRIVER_ATTR_RW(busy_retry);
229  
230  /*******************************************************************************
231  *                                                                              *
232 --- lin_tape-3.0.20/stmp.c~     2017-11-18 09:30:20.000000000 +0100
233 +++ lin_tape-3.0.20/stmp.c      2017-11-18 09:39:11.483862824 +0100
234 @@ -5473,29 +5473,29 @@
235  #else // < 4.4.21
236  
237  /* The sysfs driver interface. Read-only at the moment */
238 -static ssize_t st_try_direct_io_show(struct device_driver *ddp, char *buf)
239 +static ssize_t try_direct_io_show(struct device_driver *ddp, char *buf)
240  {
241         return snprintf(buf, PAGE_SIZE, "%d\n", try_direct_io);
242  }
243 -static DRIVER_ATTR(try_direct_io, S_IRUGO, st_try_direct_io_show, NULL);
244 +static DRIVER_ATTRRO(try_direct_io);
245  
246 -static ssize_t st_fixed_buffer_size_show(struct device_driver *ddp, char *buf)
247 +static ssize_t fixed_buffer_size_show(struct device_driver *ddp, char *buf)
248  {
249         return snprintf(buf, PAGE_SIZE, "%d\n", st_fixed_buffer_size);
250  }
251 -static DRIVER_ATTR(fixed_buffer_size, S_IRUGO, st_fixed_buffer_size_show, NULL);
252 +static DRIVER_ATTR_RW(fixed_buffer_size);
253  
254 -static ssize_t st_max_sg_segs_show(struct device_driver *ddp, char *buf)
255 +static ssize_t max_sg_segs_show(struct device_driver *ddp, char *buf)
256  {
257         return snprintf(buf, PAGE_SIZE, "%d\n", st_max_sg_segs);
258  }
259 -static DRIVER_ATTR(max_sg_segs, S_IRUGO, st_max_sg_segs_show, NULL);
260 +static DRIVER_ATTR_RO(max_sg_segs);
261  
262 -static ssize_t st_version_show(struct device_driver *ddd, char *buf)
263 +static ssize_t version_show(struct device_driver *ddd, char *buf)
264  {
265         return snprintf(buf, PAGE_SIZE, "[%s]\n", verstr);
266  }
267 -static DRIVER_ATTR(version, S_IRUGO, st_version_show, NULL);
268 +static DRIVER_ATTR_RO(version);
269  
270  static int do_create_sysfs_files(void)
271  {
This page took 0.044013 seconds and 2 git commands to generate.