From 8591cf43224980a0bc9216a4e50b0a740f8cba35 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Sat, 4 Oct 2008 23:40:23 +0400 Subject: proc: move /proc/cpuinfo code to fs/proc/cpuinfo.c Signed-off-by: Alexey Dobriyan --- fs/proc/cpuinfo.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fs/proc/cpuinfo.c (limited to 'fs/proc/cpuinfo.c') 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 @@ +#include +#include +#include +#include + +extern const struct seq_operations cpuinfo_op; +static int cpuinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &cpuinfo_op); +} + +static const struct file_operations proc_cpuinfo_operations = { + .open = cpuinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int __init proc_cpuinfo_init(void) +{ + proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); + return 0; +} +module_init(proc_cpuinfo_init); -- cgit v1.2.1