lkml.org 
[lkml]   [2010]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 03/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

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
include/linux/threads.h | 1 +
kernel/fork.c | 1 +
kernel/kmod.c | 3 +--
kernel/sysctl.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.32.orig/include/linux/threads.h 2010-02-12 12:47:27.001982416 +0800
+++ linux-2.6.32/include/linux/threads.h 2010-02-12 12:48:49.593449580 +0800
@@ -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
--- linux-2.6.32.orig/kernel/fork.c 2010-02-12 12:46:48.602820586 +0800
+++ linux-2.6.32/kernel/fork.c 2010-02-12 12:50:36.868631765 +0800
@@ -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>
--- linux-2.6.32.orig/kernel/kmod.c 2010-02-12 12:46:45.736154059 +0800
+++ linux-2.6.32/kernel/kmod.c 2010-02-12 12:49:29.128638259 +0800
@@ -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
--- linux-2.6.32.orig/kernel/sysctl.c 2010-02-12 12:46:42.202820096 +0800
+++ linux-2.6.32/kernel/sysctl.c 2010-02-12 12:50:08.065301362 +0800
@@ -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;

\
 
 \ /
  Last update: 2010-02-20 15:11    [W:0.023 / U:3.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site