proc: move /proc/schedstat boilerplate to kernel/sched_stats.h

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
This commit is contained in:
Alexey Dobriyan
2008-10-06 13:23:43 +04:00
parent 3b5d5c6b0c
commit b5aadf7f14
4 changed files with 9 additions and 8 deletions

View File

@@ -55,6 +55,7 @@
#include <linux/cpuset.h>
#include <linux/percpu.h>
#include <linux/kthread.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/sysctl.h>
#include <linux/syscalls.h>

View File

@@ -90,13 +90,20 @@ static int schedstat_open(struct inode *inode, struct file *file)
return res;
}
const struct file_operations proc_schedstat_operations = {
static const struct file_operations proc_schedstat_operations = {
.open = schedstat_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int __init proc_schedstat_init(void)
{
proc_create("schedstat", 0, NULL, &proc_schedstat_operations);
return 0;
}
module_init(proc_schedstat_init);
/*
* Expects runqueue lock to be held for atomicity of update
*/