-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proc: move /proc/cpuinfo code to fs/proc/cpuinfo.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
- Loading branch information
Alexey Dobriyan
committed
Oct 23, 2008
1 parent
fe25104
commit 8591cf4
Showing
3 changed files
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <linux/fs.h> | ||
#include <linux/init.h> | ||
#include <linux/proc_fs.h> | ||
#include <linux/seq_file.h> | ||
|
||
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters