Skip to content

Commit cf626b0

Browse files
committed
Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull procfs updates from Al Viro: "Christoph's proc_create_... cleanups series" * 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits) xfs, proc: hide unused xfs procfs helpers isdn/gigaset: add back gigaset_procinfo assignment proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields tty: replace ->proc_fops with ->proc_show ide: replace ->proc_fops with ->proc_show ide: remove ide_driver_proc_write isdn: replace ->proc_fops with ->proc_show atm: switch to proc_create_seq_private atm: simplify procfs code bluetooth: switch to proc_create_seq_data netfilter/x_tables: switch to proc_create_seq_private netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data neigh: switch to proc_create_seq_data hostap: switch to proc_create_{seq,single}_data bonding: switch to proc_create_seq_data rtc/proc: switch to proc_create_single_data drbd: switch to proc_create_single resource: switch to proc_create_seq_data staging/rtl8192u: simplify procfs code jfs: simplify procfs code ...
2 parents 9c50eaf + 5ef03db commit cf626b0

File tree

266 files changed

+1229
-6032
lines changed

Some content is hidden

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

266 files changed

+1229
-6032
lines changed

arch/arm/kernel/dma.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,21 +276,9 @@ static int proc_dma_show(struct seq_file *m, void *v)
276276
return 0;
277277
}
278278

279-
static int proc_dma_open(struct inode *inode, struct file *file)
280-
{
281-
return single_open(file, proc_dma_show, NULL);
282-
}
283-
284-
static const struct file_operations proc_dma_operations = {
285-
.open = proc_dma_open,
286-
.read = seq_read,
287-
.llseek = seq_lseek,
288-
.release = single_release,
289-
};
290-
291279
static int __init proc_dma_init(void)
292280
{
293-
proc_create("dma", 0, NULL, &proc_dma_operations);
281+
proc_create_single("dma", 0, NULL, proc_dma_show);
294282
return 0;
295283
}
296284

arch/arm/kernel/swp_emulate.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,6 @@ static int proc_status_show(struct seq_file *m, void *v)
9191
seq_printf(m, "Last process:\t\t%d\n", previous_pid);
9292
return 0;
9393
}
94-
95-
static int proc_status_open(struct inode *inode, struct file *file)
96-
{
97-
return single_open(file, proc_status_show, PDE_DATA(inode));
98-
}
99-
100-
static const struct file_operations proc_status_fops = {
101-
.open = proc_status_open,
102-
.read = seq_read,
103-
.llseek = seq_lseek,
104-
.release = single_release,
105-
};
10694
#endif
10795

10896
/*
@@ -260,7 +248,8 @@ static int __init swp_emulation_init(void)
260248
return 0;
261249

262250
#ifdef CONFIG_PROC_FS
263-
if (!proc_create("cpu/swp_emulation", S_IRUGO, NULL, &proc_status_fops))
251+
if (!proc_create_single("cpu/swp_emulation", S_IRUGO, NULL,
252+
proc_status_show))
264253
return -ENOMEM;
265254
#endif /* CONFIG_PROC_FS */
266255

arch/arm/mach-rpc/ecard.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -657,25 +657,13 @@ static int ecard_devices_proc_show(struct seq_file *m, void *v)
657657
return 0;
658658
}
659659

660-
static int ecard_devices_proc_open(struct inode *inode, struct file *file)
661-
{
662-
return single_open(file, ecard_devices_proc_show, NULL);
663-
}
664-
665-
static const struct file_operations bus_ecard_proc_fops = {
666-
.owner = THIS_MODULE,
667-
.open = ecard_devices_proc_open,
668-
.read = seq_read,
669-
.llseek = seq_lseek,
670-
.release = single_release,
671-
};
672-
673660
static struct proc_dir_entry *proc_bus_ecard_dir = NULL;
674661

675662
static void ecard_proc_init(void)
676663
{
677664
proc_bus_ecard_dir = proc_mkdir("bus/ecard", NULL);
678-
proc_create("devices", 0, proc_bus_ecard_dir, &bus_ecard_proc_fops);
665+
proc_create_single("devices", 0, proc_bus_ecard_dir,
666+
ecard_devices_proc_show);
679667
}
680668

681669
#define ec_set_resource(ec,nr,st,sz) \

arch/ia64/hp/common/sba_iommu.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,19 +1942,6 @@ static const struct seq_operations ioc_seq_ops = {
19421942
.show = ioc_show
19431943
};
19441944

1945-
static int
1946-
ioc_open(struct inode *inode, struct file *file)
1947-
{
1948-
return seq_open(file, &ioc_seq_ops);
1949-
}
1950-
1951-
static const struct file_operations ioc_fops = {
1952-
.open = ioc_open,
1953-
.read = seq_read,
1954-
.llseek = seq_lseek,
1955-
.release = seq_release
1956-
};
1957-
19581945
static void __init
19591946
ioc_proc_init(void)
19601947
{
@@ -1964,7 +1951,7 @@ ioc_proc_init(void)
19641951
if (!dir)
19651952
return;
19661953

1967-
proc_create(ioc_list->name, 0, dir, &ioc_fops);
1954+
proc_create_seq(ioc_list->name, 0, dir, &ioc_seq_ops);
19681955
}
19691956
#endif
19701957

arch/ia64/hp/sim/simserial.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
435435
return 0;
436436
}
437437

438-
static int rs_proc_open(struct inode *inode, struct file *file)
439-
{
440-
return single_open(file, rs_proc_show, NULL);
441-
}
442-
443-
static const struct file_operations rs_proc_fops = {
444-
.owner = THIS_MODULE,
445-
.open = rs_proc_open,
446-
.read = seq_read,
447-
.llseek = seq_lseek,
448-
.release = single_release,
449-
};
450-
451438
static const struct tty_operations hp_ops = {
452439
.open = rs_open,
453440
.close = rs_close,
@@ -462,7 +449,7 @@ static const struct tty_operations hp_ops = {
462449
.unthrottle = rs_unthrottle,
463450
.send_xchar = rs_send_xchar,
464451
.hangup = rs_hangup,
465-
.proc_fops = &rs_proc_fops,
452+
.proc_show = rs_proc_show,
466453
};
467454

468455
static const struct tty_port_operations hp_port_ops = {

arch/ia64/kernel/palinfo.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -920,18 +920,6 @@ static int proc_palinfo_show(struct seq_file *m, void *v)
920920
return 0;
921921
}
922922

923-
static int proc_palinfo_open(struct inode *inode, struct file *file)
924-
{
925-
return single_open(file, proc_palinfo_show, PDE_DATA(inode));
926-
}
927-
928-
static const struct file_operations proc_palinfo_fops = {
929-
.open = proc_palinfo_open,
930-
.read = seq_read,
931-
.llseek = seq_lseek,
932-
.release = single_release,
933-
};
934-
935923
static int palinfo_add_proc(unsigned int cpu)
936924
{
937925
pal_func_cpu_u_t f;
@@ -948,8 +936,8 @@ static int palinfo_add_proc(unsigned int cpu)
948936

949937
for (j=0; j < NR_PALINFO_ENTRIES; j++) {
950938
f.func_id = j;
951-
proc_create_data(palinfo_entries[j].name, 0, cpu_dir,
952-
&proc_palinfo_fops, (void *)f.value);
939+
proc_create_single_data(palinfo_entries[j].name, 0, cpu_dir,
940+
proc_palinfo_show, (void *)f.value);
953941
}
954942
return 0;
955943
}

arch/ia64/kernel/perfmon.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5708,13 +5708,6 @@ const struct seq_operations pfm_seq_ops = {
57085708
.show = pfm_proc_show
57095709
};
57105710

5711-
static int
5712-
pfm_proc_open(struct inode *inode, struct file *file)
5713-
{
5714-
return seq_open(file, &pfm_seq_ops);
5715-
}
5716-
5717-
57185711
/*
57195712
* we come here as soon as local_cpu_data->pfm_syst_wide is set. this happens
57205713
* during pfm_enable() hence before pfm_start(). We cannot assume monitoring
@@ -6537,13 +6530,6 @@ pfm_probe_pmu(void)
65376530
return 0;
65386531
}
65396532

6540-
static const struct file_operations pfm_proc_fops = {
6541-
.open = pfm_proc_open,
6542-
.read = seq_read,
6543-
.llseek = seq_lseek,
6544-
.release = seq_release,
6545-
};
6546-
65476533
int __init
65486534
pfm_init(void)
65496535
{
@@ -6615,7 +6601,7 @@ pfm_init(void)
66156601
/*
66166602
* create /proc/perfmon (mostly for debugging purposes)
66176603
*/
6618-
perfmon_dir = proc_create("perfmon", S_IRUGO, NULL, &pfm_proc_fops);
6604+
perfmon_dir = proc_create_seq("perfmon", S_IRUGO, NULL, &pfm_seq_ops);
66196605
if (perfmon_dir == NULL) {
66206606
printk(KERN_ERR "perfmon: cannot create /proc entry, perfmon disabled\n");
66216607
pmu_conf = NULL;

arch/ia64/kernel/salinfo.c

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ MODULE_AUTHOR("Jesse Barnes <jbarnes@sgi.com>");
5454
MODULE_DESCRIPTION("/proc interface to IA-64 SAL features");
5555
MODULE_LICENSE("GPL");
5656

57-
static const struct file_operations proc_salinfo_fops;
58-
5957
typedef struct {
6058
const char *name; /* name of the proc entry */
6159
unsigned long feature; /* feature bit */
@@ -578,6 +576,17 @@ static int salinfo_cpu_pre_down(unsigned int cpu)
578576
return 0;
579577
}
580578

579+
/*
580+
* 'data' contains an integer that corresponds to the feature we're
581+
* testing
582+
*/
583+
static int proc_salinfo_show(struct seq_file *m, void *v)
584+
{
585+
unsigned long data = (unsigned long)v;
586+
seq_puts(m, (sal_platform_features & data) ? "1\n" : "0\n");
587+
return 0;
588+
}
589+
581590
static int __init
582591
salinfo_init(void)
583592
{
@@ -593,9 +602,9 @@ salinfo_init(void)
593602

594603
for (i=0; i < NR_SALINFO_ENTRIES; i++) {
595604
/* pass the feature bit in question as misc data */
596-
*sdir++ = proc_create_data(salinfo_entries[i].name, 0, salinfo_dir,
597-
&proc_salinfo_fops,
598-
(void *)salinfo_entries[i].feature);
605+
*sdir++ = proc_create_single_data(salinfo_entries[i].name, 0,
606+
salinfo_dir, proc_salinfo_show,
607+
(void *)salinfo_entries[i].feature);
599608
}
600609

601610
for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {
@@ -633,27 +642,4 @@ salinfo_init(void)
633642
return 0;
634643
}
635644

636-
/*
637-
* 'data' contains an integer that corresponds to the feature we're
638-
* testing
639-
*/
640-
static int proc_salinfo_show(struct seq_file *m, void *v)
641-
{
642-
unsigned long data = (unsigned long)v;
643-
seq_puts(m, (sal_platform_features & data) ? "1\n" : "0\n");
644-
return 0;
645-
}
646-
647-
static int proc_salinfo_open(struct inode *inode, struct file *file)
648-
{
649-
return single_open(file, proc_salinfo_show, PDE_DATA(inode));
650-
}
651-
652-
static const struct file_operations proc_salinfo_fops = {
653-
.open = proc_salinfo_open,
654-
.read = seq_read,
655-
.llseek = seq_lseek,
656-
.release = single_release,
657-
};
658-
659645
module_init(salinfo_init);

arch/ia64/sn/kernel/sn2/prominfo_proc.c

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,6 @@ static int proc_fit_show(struct seq_file *m, void *v)
140140
return 0;
141141
}
142142

143-
static int proc_fit_open(struct inode *inode, struct file *file)
144-
{
145-
return single_open(file, proc_fit_show, PDE_DATA(inode));
146-
}
147-
148-
static const struct file_operations proc_fit_fops = {
149-
.open = proc_fit_open,
150-
.read = seq_read,
151-
.llseek = seq_lseek,
152-
.release = single_release,
153-
};
154-
155143
static int proc_version_show(struct seq_file *m, void *v)
156144
{
157145
unsigned long nasid = (unsigned long)m->private;
@@ -174,18 +162,6 @@ static int proc_version_show(struct seq_file *m, void *v)
174162
return 0;
175163
}
176164

177-
static int proc_version_open(struct inode *inode, struct file *file)
178-
{
179-
return single_open(file, proc_version_show, PDE_DATA(inode));
180-
}
181-
182-
static const struct file_operations proc_version_fops = {
183-
.open = proc_version_open,
184-
.read = seq_read,
185-
.llseek = seq_lseek,
186-
.release = single_release,
187-
};
188-
189165
/* module entry points */
190166
int __init prominfo_init(void);
191167
void __exit prominfo_exit(void);
@@ -217,10 +193,10 @@ int __init prominfo_init(void)
217193
if (!dir)
218194
continue;
219195
nasid = cnodeid_to_nasid(cnodeid);
220-
proc_create_data("fit", 0, dir,
221-
&proc_fit_fops, (void *)nasid);
222-
proc_create_data("version", 0, dir,
223-
&proc_version_fops, (void *)nasid);
196+
proc_create_single_data("fit", 0, dir, proc_fit_show,
197+
(void *)nasid);
198+
proc_create_single_data("version", 0, dir, proc_version_show,
199+
(void *)nasid);
224200
}
225201
return 0;
226202
}

0 commit comments

Comments
 (0)