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
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)
11 sscanf(buf, "0x%x", &pfo_debug_flag);
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)
20 return scnprintf(buf, PAGE_SIZE,
21 "debug flag=%04x\necho 0x<hexvalue> > debug_flag to change\n",
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);
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)
34 if (debug_buffer[0] == '\001') {
39 -static DRIVER_ATTR(debug_buffer, S_IRUGO, pfoattr_debug_buffer_get, NULL);
40 +static DRIVER_ATTR_RO(debug_buffer);
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)
53 -static DRIVER_ATTR(trace, S_IRUGO, pfoattr_debug_trace_get, NULL);
54 +static DRIVER_ATTR_RO(trace);
56 int init_debug(struct device_driver *pfo_gendrv)
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
61 /** Perform the operations the customer has requested when they wrote to
62 * /sys/bus/scsi/drivers/pfo/ctrl
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,
68 intercept_ctrl(NULL, buf, count);
70 * /sys/bus/scsi/drivers/pfo/ctrl
71 * @return string length
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)
76 return resolve_ctrl_get(buf, PAGE_SIZE);
78 -static DRIVER_ATTR(ctrl, S_IRUGO|S_IWUSR|S_IWGRP, pfoattr_ctrl_get,
80 +static DRIVER_ATTR_RW(ctrl);
83 /** Create the text the customer will see when they read
84 * /sys/bus/scsi/drivers/pfo/version
85 * @return string length
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)
90 return snprintf(buf, PAGE_SIZE, "[%s]\n", PFO_DATE_STR);
92 -static DRIVER_ATTR(version, S_IRUGO, pfo_version_show, NULL);
93 +static DRIVER_ATTR_RO(version);
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
101 *******************************************************************************/
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)
110 } /* tape_version_show() */
112 -DRIVER_ATTR(version, 0444, tape_version_show, NULL);
113 +DRIVER_ATTR_RO(version);
115 /*******************************************************************************
119 } /* lin_tape_debug_store() */
121 -DRIVER_ATTR(lin_tape_debug, 0660, lin_tape_debug_show, lin_tape_debug_store);
122 +DRIVER_ATTR_RW(lin_tape_debug);
124 /*******************************************************************************
128 } /* auto_logging_store() */
130 -DRIVER_ATTR(auto_logging, 0660, auto_logging_show, auto_logging_store);
131 +DRIVER_ATTR_RW(auto_logging);
133 /*******************************************************************************
137 } /* petro_store() */
139 -DRIVER_ATTR(petro, 0660, petro_show, petro_store);
140 +DRIVER_ATTR_RW(petro);
142 /*******************************************************************************
146 } /* support_dio_store() */
148 -DRIVER_ATTR(support_dio, 0660, support_dio_show, support_dio_store);
149 +DRIVER_ATTR_RW(support_dio);
151 /*******************************************************************************
155 } /* wait_on_config_show() */
157 -DRIVER_ATTR(wait_on_config, 0444, wait_on_config_show, NULL);
158 +DRIVER_ATTR_RO(wait_on_config);
160 /*******************************************************************************
164 } /* changer_open_reserve_show() */
166 -DRIVER_ATTR(changer_open_reserve, 0660, changer_open_reserve_show,
167 - changer_open_reserve_store);
168 +DRIVER_ATTR_RW(changer_open_reserve);
170 /*******************************************************************************
174 } /* default_sys_encryption_proxy_store() */
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);
181 /*******************************************************************************
185 } /* default_sys_encryption_write_show() */
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);
192 /*******************************************************************************
196 } /* disable_density_on_open_store() */
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);
202 /*******************************************************************************
206 } /* dynamic_attributes_store() */
208 -DRIVER_ATTR(dynamic_attributes, 0660, dynamic_attributes_show,
209 - dynamic_attributes_store);
210 +DRIVER_ATTR_RW(dynamic_attributes);
212 /*******************************************************************************
216 } /* disable_auto_drive_dump_store() */
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);
221 /*******************************************************************************
225 } /* busy_retry_store() */
227 -DRIVER_ATTR(busy_retry, 0660, busy_retry_show, busy_retry_store);
228 +DRIVER_ATTR_RW(busy_retry);
230 /*******************************************************************************
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 @@
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)
241 return snprintf(buf, PAGE_SIZE, "%d\n", try_direct_io);
243 -static DRIVER_ATTR(try_direct_io, S_IRUGO, st_try_direct_io_show, NULL);
244 +static DRIVER_ATTRRO(try_direct_io);
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)
249 return snprintf(buf, PAGE_SIZE, "%d\n", st_fixed_buffer_size);
251 -static DRIVER_ATTR(fixed_buffer_size, S_IRUGO, st_fixed_buffer_size_show, NULL);
252 +static DRIVER_ATTR_RW(fixed_buffer_size);
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)
257 return snprintf(buf, PAGE_SIZE, "%d\n", st_max_sg_segs);
259 -static DRIVER_ATTR(max_sg_segs, S_IRUGO, st_max_sg_segs_show, NULL);
260 +static DRIVER_ATTR_RO(max_sg_segs);
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)
265 return snprintf(buf, PAGE_SIZE, "[%s]\n", verstr);
267 -static DRIVER_ATTR(version, S_IRUGO, st_version_show, NULL);
268 +static DRIVER_ATTR_RO(version);
270 static int do_create_sysfs_files(void)