lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20081017125301.GB22653@x200.localdomain>
Date:	Fri, 17 Oct 2008 16:53:01 +0400
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	mingo@...e.hu
Subject: [PATCH 27/31] proc: move /proc/schedstat boilerplate to
	kernel/sched_stats.h


>From df061e2eb4f51b50946f057dad1e5e7ce967fd85 Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan <adobriyan@...il.com>
Date: Mon, 6 Oct 2008 13:23:43 +0400
Subject: [PATCH 27/31] proc: move /proc/schedstat boilerplate to kernel/sched_stats.h

Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
 fs/proc/proc_misc.c   |    3 ---
 include/linux/sched.h |    4 ----
 kernel/sched.c        |    1 +
 kernel/sched_stats.h  |    9 ++++++++-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 429376e..981efbf 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -194,9 +194,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/include/linux/sched.h b/include/linux/sched.h
index c226c7b..a6f584b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -638,10 +638,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/kernel/sched.c b/kernel/sched.c
index 6f23059..973cc94 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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>
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
index 8385d43..6967055 100644
--- a/kernel/sched_stats.h
+++ b/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
  */
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ