Skip to contentSkip to conversation

sysctl extern cleanup - threads

PATCH In review Dave Young 1 participant 1 message Feb 20, 2010

Subsystems (4)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 3/18 sysctl extern cleanup - threads

Extern declarations in sysctl.c should be move to their own head file, and then include them in relavant .c files.

Move max_threads extern declaration to linux/threads.h

---
 include/linux/threads.h |    1 +
 kernel/fork.c           |    1 +
 kernel/kmod.c           |    3 +--
 kernel/sysctl.c         |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)
include/linux/threads.h +1 -0
@@ -6,6 +6,7 @@
  * The default limit for the nr of threads is now in
  * /proc/sys/kernel/threads-max.
  */
+extern int max_threads;
 
 /*
  * Maximum supported processors.  Setting this smaller saves quite a
kernel/fork.c +1 -0
@@ -65,6 +65,7 @@
 #include <linux/perf_event.h>
 #include <linux/posix-timers.h>
 #include <linux/user-return-notifier.h>
+#include <linux/threads.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
kernel/kmod.c +1 -2
@@ -36,12 +36,11 @@
 #include <linux/notifier.h>
 #include <linux/suspend.h>
 #include <linux/rcustring.h>
+#include <linux/threads.h>
 #include <asm/uaccess.h>
 
 #include <trace/events/module.h>
 
-extern int max_threads;
-
 static struct workqueue_struct *khelper_wq;
 
 #ifdef CONFIG_MODULES
kernel/sysctl.c +1 -1
@@ -55,6 +55,7 @@
 #include <linux/perf_event.h>
 #include <linux/rcustring.h>
 #include <linux/signal.h>
+#include <linux/threads.h>
 
 #include <asm/uaccess.h>
 #include <asm/processor.h>
@@ -69,7 +70,6 @@
 #if defined(CONFIG_SYSCTL)
 
 /* External variables not in a header file. */
-extern int max_threads;
 extern int core_uses_pid;
 extern int suid_dumpable;
 extern char *core_pattern;