瀏覽代碼

sysctl extern cleanup: module

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

Move modprobe_path extern declaration to linux/kmod.h
Move modules_disabled extern declaration to linux/module.h

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dave Young 15 年之前
父節點
當前提交
5ed109103d
共有 3 個文件被更改,包括 2 次插入4 次删除
  1. 1 0
      include/linux/kmod.h
  2. 1 0
      include/linux/module.h
  3. 0 4
      kernel/sysctl.c

+ 1 - 0
include/linux/kmod.h

@@ -27,6 +27,7 @@
 #define KMOD_PATH_LEN 256
 #define KMOD_PATH_LEN 256
 
 
 #ifdef CONFIG_MODULES
 #ifdef CONFIG_MODULES
+extern char modprobe_path[]; /* for sysctl */
 /* modprobe exit status on success, -ve on error.  Return value
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
  * usually useless though. */
 extern int __request_module(bool wait, const char *name, ...) \
 extern int __request_module(bool wait, const char *name, ...) \

+ 1 - 0
include/linux/module.h

@@ -175,6 +175,7 @@ struct notifier_block;
 
 
 #ifdef CONFIG_MODULES
 #ifdef CONFIG_MODULES
 
 
+extern int modules_disabled; /* for sysctl */
 /* Get/put a kernel symbol (calls must be symmetric) */
 /* Get/put a kernel symbol (calls must be symmetric) */
 void *__symbol_get(const char *symbol);
 void *__symbol_get(const char *symbol);
 void *__symbol_get_gpl(const char *symbol);
 void *__symbol_get_gpl(const char *symbol);

+ 0 - 4
kernel/sysctl.c

@@ -116,10 +116,6 @@ static int min_percpu_pagelist_fract = 8;
 
 
 static int ngroups_max = NGROUPS_MAX;
 static int ngroups_max = NGROUPS_MAX;
 
 
-#ifdef CONFIG_MODULES
-extern char modprobe_path[];
-extern int modules_disabled;
-#endif
 #ifdef CONFIG_CHR_DEV_SG
 #ifdef CONFIG_CHR_DEV_SG
 extern int sg_big_buff;
 extern int sg_big_buff;
 #endif
 #endif