aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-04 15:40:23 -0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 07:05:11 -0400
commit8591cf43224980a0bc9216a4e50b0a740f8cba35 (patch)
treef3af8c5a36528b961c95354662c38a5f06d406aa /fs/proc
parentfe2510426a02dd2fefcb0389b60f77cbe0462289 (diff)
proc: move /proc/cpuinfo code to fs/proc/cpuinfo.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/Makefile1
-rw-r--r--fs/proc/cpuinfo.c24
-rw-r--r--fs/proc/proc_misc.c14
3 files changed, 25 insertions, 14 deletions
diff --git a/fs/proc/Makefile b/fs/proc/Makefile
index f24ebfdc5b4f..c91cc9c283bd 100644
--- a/fs/proc/Makefile
+++ b/fs/proc/Makefile
@@ -10,6 +10,7 @@ proc-$(CONFIG_MMU) := mmu.o task_mmu.o
10proc-y += inode.o root.o base.o generic.o array.o \ 10proc-y += inode.o root.o base.o generic.o array.o \
11 proc_tty.o proc_misc.o 11 proc_tty.o proc_misc.o
12proc-y += cmdline.o 12proc-y += cmdline.o
13proc-y += cpuinfo.o
13proc-y += devices.o 14proc-y += devices.o
14proc-y += loadavg.o 15proc-y += loadavg.o
15proc-y += meminfo.o 16proc-y += meminfo.o
diff --git a/fs/proc/cpuinfo.c b/fs/proc/cpuinfo.c
new file mode 100644
index 000000000000..5a1e539a234b
--- /dev/null
+++ b/fs/proc/cpuinfo.c
@@ -0,0 +1,24 @@
1#include <linux/fs.h>
2#include <linux/init.h>
3#include <linux/proc_fs.h>
4#include <linux/seq_file.h>
5
6extern const struct seq_operations cpuinfo_op;
7static int cpuinfo_open(struct inode *inode, struct file *file)
8{
9 return seq_open(file, &cpuinfo_op);
10}
11
12static const struct file_operations proc_cpuinfo_operations = {
13 .open = cpuinfo_open,
14 .read = seq_read,
15 .llseek = seq_lseek,
16 .release = seq_release,
17};
18
19static int __init proc_cpuinfo_init(void)
20{
21 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
22 return 0;
23}
24module_init(proc_cpuinfo_init);
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index a6fadc0cc4b0..8974809be5f6 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -94,19 +94,6 @@ static const struct file_operations proc_zoneinfo_file_operations = {
94 .release = seq_release, 94 .release = seq_release,
95}; 95};
96 96
97extern const struct seq_operations cpuinfo_op;
98static int cpuinfo_open(struct inode *inode, struct file *file)
99{
100 return seq_open(file, &cpuinfo_op);
101}
102
103static const struct file_operations proc_cpuinfo_operations = {
104 .open = cpuinfo_open,
105 .read = seq_read,
106 .llseek = seq_lseek,
107 .release = seq_release,
108};
109
110static int vmstat_open(struct inode *inode, struct file *file) 97static int vmstat_open(struct inode *inode, struct file *file)
111{ 98{
112 return seq_open(file, &vmstat_op); 99 return seq_open(file, &vmstat_op);
@@ -532,7 +519,6 @@ void __init proc_misc_init(void)
532 proc_symlink("mounts", NULL, "self/mounts"); 519 proc_symlink("mounts", NULL, "self/mounts");
533 520
534 /* And now for trickier ones */ 521 /* And now for trickier ones */
535 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
536#ifdef CONFIG_BLOCK 522#ifdef CONFIG_BLOCK
537 proc_create("partitions", 0, NULL, &proc_partitions_operations); 523 proc_create("partitions", 0, NULL, &proc_partitions_operations);
538#endif 524#endif