From 252933339a5600e1d09a66726cdab0a14606bda3 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Mon, 6 Oct 2008 13:23:43 +0400 Subject: [PATCH] --- yaml --- r: 117667 b: refs/heads/master c: b5aadf7f14c1acc94956aa257e018e9de3881f41 h: refs/heads/master i: 117665: 44e719657b4ac63bba5e63ba0dda6c4da7d95bd5 117663: 3a618af64de25dc2e81221be5210be730ad5202c v: v3 --- [refs] | 2 +- trunk/fs/proc/proc_misc.c | 3 --- trunk/include/linux/sched.h | 4 ---- trunk/kernel/sched.c | 1 + trunk/kernel/sched_stats.h | 9 ++++++++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 3cdbf45f4d39..4aeef5980729 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3b5d5c6b0ccba733a313f8752ebc3f8015628ba3 +refs/heads/master: b5aadf7f14c1acc94956aa257e018e9de3881f41 diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c index f6d25db98922..4a768ed5da2e 100644 --- a/trunk/fs/proc/proc_misc.c +++ b/trunk/fs/proc/proc_misc.c @@ -195,9 +195,6 @@ void __init proc_misc_init(void) proc_symlink("mounts", NULL, "self/mounts"); /* And now for trickier ones */ -#ifdef CONFIG_SCHEDSTATS - proc_create("schedstat", 0, NULL, &proc_schedstat_operations); -#endif #ifdef CONFIG_PROC_KCORE proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); if (proc_root_kcore) diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 5c38db536e07..7f60cb9b53cb 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -681,10 +681,6 @@ struct sched_info { }; #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ -#ifdef CONFIG_SCHEDSTATS -extern const struct file_operations proc_schedstat_operations; -#endif /* CONFIG_SCHEDSTATS */ - #ifdef CONFIG_TASK_DELAY_ACCT struct task_delay_info { spinlock_t lock; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index d906f72b42d2..5a70189d5051 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/kernel/sched_stats.h b/trunk/kernel/sched_stats.h index b8c156979cf2..3d14ce273902 100644 --- a/trunk/kernel/sched_stats.h +++ b/trunk/kernel/sched_stats.h @@ -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 */