Skip to content

Commit 97a3253

Browse files
Alexey Dobriyantorvalds
Alexey Dobriyan
authored andcommitted
proc: convert everything to "struct proc_ops"
The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in seq_file.h. Conversion rule is: llseek => proc_lseek unlocked_ioctl => proc_ioctl xxx => proc_xxx delete ".owner = THIS_MODULE" line [[email protected]: fix drivers/isdn/capi/kcapi_proc.c] [[email protected]: fix kernel/sched/psi.c] Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2 Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d56c0d4 commit 97a3253

File tree

100 files changed

+961
-1006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+961
-1006
lines changed

arch/alpha/kernel/srm_env.c

+8-9
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,12 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
119119
return res;
120120
}
121121

122-
static const struct file_operations srm_env_proc_fops = {
123-
.owner = THIS_MODULE,
124-
.open = srm_env_proc_open,
125-
.read = seq_read,
126-
.llseek = seq_lseek,
127-
.release = single_release,
128-
.write = srm_env_proc_write,
122+
static const struct proc_ops srm_env_proc_ops = {
123+
.proc_open = srm_env_proc_open,
124+
.proc_read = seq_read,
125+
.proc_lseek = seq_lseek,
126+
.proc_release = single_release,
127+
.proc_write = srm_env_proc_write,
129128
};
130129

131130
static int __init
@@ -182,7 +181,7 @@ srm_env_init(void)
182181
entry = srm_named_entries;
183182
while (entry->name && entry->id) {
184183
if (!proc_create_data(entry->name, 0644, named_dir,
185-
&srm_env_proc_fops, (void *)entry->id))
184+
&srm_env_proc_ops, (void *)entry->id))
186185
goto cleanup;
187186
entry++;
188187
}
@@ -194,7 +193,7 @@ srm_env_init(void)
194193
char name[4];
195194
sprintf(name, "%ld", var_num);
196195
if (!proc_create_data(name, 0644, numbered_dir,
197-
&srm_env_proc_fops, (void *)var_num))
196+
&srm_env_proc_ops, (void *)var_num))
198197
goto cleanup;
199198
}
200199

arch/arm/kernel/atags_proc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ static ssize_t atags_read(struct file *file, char __user *buf,
1717
return simple_read_from_buffer(buf, count, ppos, b->data, b->size);
1818
}
1919

20-
static const struct file_operations atags_fops = {
21-
.read = atags_read,
22-
.llseek = default_llseek,
20+
static const struct proc_ops atags_proc_ops = {
21+
.proc_read = atags_read,
22+
.proc_lseek = default_llseek,
2323
};
2424

2525
#define BOOT_PARAMS_SIZE 1536
@@ -61,7 +61,7 @@ static int __init init_atags_procfs(void)
6161
b->size = size;
6262
memcpy(b->data, atags_copy, size);
6363

64-
tags_entry = proc_create_data("atags", 0400, NULL, &atags_fops, b);
64+
tags_entry = proc_create_data("atags", 0400, NULL, &atags_proc_ops, b);
6565
if (!tags_entry)
6666
goto nomem;
6767

arch/arm/mm/alignment.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ static ssize_t alignment_proc_write(struct file *file, const char __user *buffer
162162
return count;
163163
}
164164

165-
static const struct file_operations alignment_proc_fops = {
166-
.open = alignment_proc_open,
167-
.read = seq_read,
168-
.llseek = seq_lseek,
169-
.release = single_release,
170-
.write = alignment_proc_write,
165+
static const struct proc_ops alignment_proc_ops = {
166+
.proc_open = alignment_proc_open,
167+
.proc_read = seq_read,
168+
.proc_lseek = seq_lseek,
169+
.proc_release = single_release,
170+
.proc_write = alignment_proc_write,
171171
};
172172
#endif /* CONFIG_PROC_FS */
173173

@@ -1016,7 +1016,7 @@ static int __init alignment_init(void)
10161016
struct proc_dir_entry *res;
10171017

10181018
res = proc_create("cpu/alignment", S_IWUSR | S_IRUGO, NULL,
1019-
&alignment_proc_fops);
1019+
&alignment_proc_ops);
10201020
if (!res)
10211021
return -ENOMEM;
10221022
#endif

arch/ia64/kernel/salinfo.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t
331331
return size;
332332
}
333333

334-
static const struct file_operations salinfo_event_fops = {
335-
.open = salinfo_event_open,
336-
.read = salinfo_event_read,
337-
.llseek = noop_llseek,
334+
static const struct proc_ops salinfo_event_proc_ops = {
335+
.proc_open = salinfo_event_open,
336+
.proc_read = salinfo_event_read,
337+
.proc_lseek = noop_llseek,
338338
};
339339

340340
static int
@@ -534,12 +534,12 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo
534534
return count;
535535
}
536536

537-
static const struct file_operations salinfo_data_fops = {
538-
.open = salinfo_log_open,
539-
.release = salinfo_log_release,
540-
.read = salinfo_log_read,
541-
.write = salinfo_log_write,
542-
.llseek = default_llseek,
537+
static const struct proc_ops salinfo_data_proc_ops = {
538+
.proc_open = salinfo_log_open,
539+
.proc_release = salinfo_log_release,
540+
.proc_read = salinfo_log_read,
541+
.proc_write = salinfo_log_write,
542+
.proc_lseek = default_llseek,
543543
};
544544

545545
static int salinfo_cpu_online(unsigned int cpu)
@@ -617,13 +617,13 @@ salinfo_init(void)
617617
continue;
618618

619619
entry = proc_create_data("event", S_IRUSR, dir,
620-
&salinfo_event_fops, data);
620+
&salinfo_event_proc_ops, data);
621621
if (!entry)
622622
continue;
623623
*sdir++ = entry;
624624

625625
entry = proc_create_data("data", S_IRUSR | S_IWUSR, dir,
626-
&salinfo_data_fops, data);
626+
&salinfo_data_proc_ops, data);
627627
if (!entry)
628628
continue;
629629
*sdir++ = entry;

arch/m68k/kernel/bootinfo_proc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ static ssize_t bootinfo_read(struct file *file, char __user *buf,
2626
bootinfo_size);
2727
}
2828

29-
static const struct file_operations bootinfo_fops = {
30-
.read = bootinfo_read,
31-
.llseek = default_llseek,
29+
static const struct proc_ops bootinfo_proc_ops = {
30+
.proc_read = bootinfo_read,
31+
.proc_lseek = default_llseek,
3232
};
3333

3434
void __init save_bootinfo(const struct bi_record *bi)
@@ -67,7 +67,7 @@ static int __init init_bootinfo_procfs(void)
6767
if (!bootinfo_copy)
6868
return -ENOMEM;
6969

70-
pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_fops, NULL);
70+
pde = proc_create_data("bootinfo", 0400, NULL, &bootinfo_proc_ops, NULL);
7171
if (!pde) {
7272
kfree(bootinfo_copy);
7373
return -ENOMEM;

arch/mips/lasat/picvue_proc.c

+14-17
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
8989
return count;
9090
}
9191

92-
static const struct file_operations pvc_line_proc_fops = {
93-
.owner = THIS_MODULE,
94-
.open = pvc_line_proc_open,
95-
.read = seq_read,
96-
.llseek = seq_lseek,
97-
.release = single_release,
98-
.write = pvc_line_proc_write,
92+
static const struct proc_ops pvc_line_proc_ops = {
93+
.proc_open = pvc_line_proc_open,
94+
.proc_read = seq_read,
95+
.proc_lseek = seq_lseek,
96+
.proc_release = single_release,
97+
.proc_write = pvc_line_proc_write,
9998
};
10099

101100
static ssize_t pvc_scroll_proc_write(struct file *file, const char __user *buf,
@@ -148,13 +147,12 @@ static int pvc_scroll_proc_open(struct inode *inode, struct file *file)
148147
return single_open(file, pvc_scroll_proc_show, NULL);
149148
}
150149

151-
static const struct file_operations pvc_scroll_proc_fops = {
152-
.owner = THIS_MODULE,
153-
.open = pvc_scroll_proc_open,
154-
.read = seq_read,
155-
.llseek = seq_lseek,
156-
.release = single_release,
157-
.write = pvc_scroll_proc_write,
150+
static const struct proc_ops pvc_scroll_proc_ops = {
151+
.proc_open = pvc_scroll_proc_open,
152+
.proc_read = seq_read,
153+
.proc_lseek = seq_lseek,
154+
.proc_release = single_release,
155+
.proc_write = pvc_scroll_proc_write,
158156
};
159157

160158
void pvc_proc_timerfunc(struct timer_list *unused)
@@ -189,12 +187,11 @@ static int __init pvc_proc_init(void)
189187
}
190188
for (i = 0; i < PVC_NLINES; i++) {
191189
proc_entry = proc_create_data(pvc_linename[i], 0644, dir,
192-
&pvc_line_proc_fops, &pvc_linedata[i]);
190+
&pvc_line_proc_ops, &pvc_linedata[i]);
193191
if (proc_entry == NULL)
194192
goto error;
195193
}
196-
proc_entry = proc_create("scroll", 0644, dir,
197-
&pvc_scroll_proc_fops);
194+
proc_entry = proc_create("scroll", 0644, dir, &pvc_scroll_proc_ops);
198195
if (proc_entry == NULL)
199196
goto error;
200197

arch/powerpc/kernel/proc_powerpc.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
3939
return 0;
4040
}
4141

42-
static const struct file_operations page_map_fops = {
43-
.llseek = page_map_seek,
44-
.read = page_map_read,
45-
.mmap = page_map_mmap
42+
static const struct proc_ops page_map_proc_ops = {
43+
.proc_lseek = page_map_seek,
44+
.proc_read = page_map_read,
45+
.proc_mmap = page_map_mmap,
4646
};
4747

4848

@@ -51,7 +51,7 @@ static int __init proc_ppc64_init(void)
5151
struct proc_dir_entry *pde;
5252

5353
pde = proc_create_data("powerpc/systemcfg", S_IFREG | 0444, NULL,
54-
&page_map_fops, vdso_data);
54+
&page_map_proc_ops, vdso_data);
5555
if (!pde)
5656
return 1;
5757
proc_set_size(pde, PAGE_SIZE);

arch/powerpc/kernel/rtas-proc.c

+35-35
Original file line numberDiff line numberDiff line change
@@ -159,64 +159,64 @@ static int poweron_open(struct inode *inode, struct file *file)
159159
return single_open(file, ppc_rtas_poweron_show, NULL);
160160
}
161161

162-
static const struct file_operations ppc_rtas_poweron_operations = {
163-
.open = poweron_open,
164-
.read = seq_read,
165-
.llseek = seq_lseek,
166-
.write = ppc_rtas_poweron_write,
167-
.release = single_release,
162+
static const struct proc_ops ppc_rtas_poweron_proc_ops = {
163+
.proc_open = poweron_open,
164+
.proc_read = seq_read,
165+
.proc_lseek = seq_lseek,
166+
.proc_write = ppc_rtas_poweron_write,
167+
.proc_release = single_release,
168168
};
169169

170170
static int progress_open(struct inode *inode, struct file *file)
171171
{
172172
return single_open(file, ppc_rtas_progress_show, NULL);
173173
}
174174

175-
static const struct file_operations ppc_rtas_progress_operations = {
176-
.open = progress_open,
177-
.read = seq_read,
178-
.llseek = seq_lseek,
179-
.write = ppc_rtas_progress_write,
180-
.release = single_release,
175+
static const struct proc_ops ppc_rtas_progress_proc_ops = {
176+
.proc_open = progress_open,
177+
.proc_read = seq_read,
178+
.proc_lseek = seq_lseek,
179+
.proc_write = ppc_rtas_progress_write,
180+
.proc_release = single_release,
181181
};
182182

183183
static int clock_open(struct inode *inode, struct file *file)
184184
{
185185
return single_open(file, ppc_rtas_clock_show, NULL);
186186
}
187187

188-
static const struct file_operations ppc_rtas_clock_operations = {
189-
.open = clock_open,
190-
.read = seq_read,
191-
.llseek = seq_lseek,
192-
.write = ppc_rtas_clock_write,
193-
.release = single_release,
188+
static const struct proc_ops ppc_rtas_clock_proc_ops = {
189+
.proc_open = clock_open,
190+
.proc_read = seq_read,
191+
.proc_lseek = seq_lseek,
192+
.proc_write = ppc_rtas_clock_write,
193+
.proc_release = single_release,
194194
};
195195

196196
static int tone_freq_open(struct inode *inode, struct file *file)
197197
{
198198
return single_open(file, ppc_rtas_tone_freq_show, NULL);
199199
}
200200

201-
static const struct file_operations ppc_rtas_tone_freq_operations = {
202-
.open = tone_freq_open,
203-
.read = seq_read,
204-
.llseek = seq_lseek,
205-
.write = ppc_rtas_tone_freq_write,
206-
.release = single_release,
201+
static const struct proc_ops ppc_rtas_tone_freq_proc_ops = {
202+
.proc_open = tone_freq_open,
203+
.proc_read = seq_read,
204+
.proc_lseek = seq_lseek,
205+
.proc_write = ppc_rtas_tone_freq_write,
206+
.proc_release = single_release,
207207
};
208208

209209
static int tone_volume_open(struct inode *inode, struct file *file)
210210
{
211211
return single_open(file, ppc_rtas_tone_volume_show, NULL);
212212
}
213213

214-
static const struct file_operations ppc_rtas_tone_volume_operations = {
215-
.open = tone_volume_open,
216-
.read = seq_read,
217-
.llseek = seq_lseek,
218-
.write = ppc_rtas_tone_volume_write,
219-
.release = single_release,
214+
static const struct proc_ops ppc_rtas_tone_volume_proc_ops = {
215+
.proc_open = tone_volume_open,
216+
.proc_read = seq_read,
217+
.proc_lseek = seq_lseek,
218+
.proc_write = ppc_rtas_tone_volume_write,
219+
.proc_release = single_release,
220220
};
221221

222222
static int ppc_rtas_find_all_sensors(void);
@@ -238,17 +238,17 @@ static int __init proc_rtas_init(void)
238238
return -ENODEV;
239239

240240
proc_create("powerpc/rtas/progress", 0644, NULL,
241-
&ppc_rtas_progress_operations);
241+
&ppc_rtas_progress_proc_ops);
242242
proc_create("powerpc/rtas/clock", 0644, NULL,
243-
&ppc_rtas_clock_operations);
243+
&ppc_rtas_clock_proc_ops);
244244
proc_create("powerpc/rtas/poweron", 0644, NULL,
245-
&ppc_rtas_poweron_operations);
245+
&ppc_rtas_poweron_proc_ops);
246246
proc_create_single("powerpc/rtas/sensors", 0444, NULL,
247247
ppc_rtas_sensors_show);
248248
proc_create("powerpc/rtas/frequency", 0644, NULL,
249-
&ppc_rtas_tone_freq_operations);
249+
&ppc_rtas_tone_freq_proc_ops);
250250
proc_create("powerpc/rtas/volume", 0644, NULL,
251-
&ppc_rtas_tone_volume_operations);
251+
&ppc_rtas_tone_volume_proc_ops);
252252
proc_create_single("powerpc/rtas/rmo_buffer", 0400, NULL,
253253
ppc_rtas_rmo_buf_show);
254254
return 0;

0 commit comments

Comments
 (0)