Commit 6eaaaac9 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  remove CONFIG_KMOD from core kernel code
  remove CONFIG_KMOD from lib
  remove CONFIG_KMOD from sparc64
  rework try_then_request_module to do less in non-modular kernels
  remove mention of CONFIG_KMOD from documentation
  make CONFIG_KMOD invisible
  modules: Take a shortcut for checking if an address is in a module
  module: turn longs into ints for module sizes
  Shrink struct module: CONFIG_UNUSED_SYMBOLS ifdefs
  module: reorder struct module to save space on 64 bit builds
  module: generic each_symbol iterator function
  module: don't use stop_machine for waiting rmmod
parents 06b8147c a1ef5adb
...@@ -26,11 +26,11 @@ You can simplify mounting by just typing: ...@@ -26,11 +26,11 @@ You can simplify mounting by just typing:
this will allocate the first available loopback device (and load loop.o this will allocate the first available loopback device (and load loop.o
kernel module if necessary) automatically. If the loopback driver is not kernel module if necessary) automatically. If the loopback driver is not
loaded automatically, make sure that your kernel is compiled with kmod loaded automatically, make sure that you have compiled the module and
support (CONFIG_KMOD) enabled. Beware that umount will not that modprobe is functioning. Beware that umount will not deallocate
deallocate /dev/loopN device if /etc/mtab file on your system is a /dev/loopN device if /etc/mtab file on your system is a symbolic link to
symbolic link to /proc/mounts. You will need to do it manually using /proc/mounts. You will need to do it manually using "-d" switch of
"-d" switch of losetup(8). Read losetup(8) manpage for more info. losetup(8). Read losetup(8) manpage for more info.
To create the BFS image under UnixWare you need to find out first which To create the BFS image under UnixWare you need to find out first which
slice contains it. The command prtvtoc(1M) is your friend: slice contains it. The command prtvtoc(1M) is your friend:
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<sect1><title>Device Components</title> <sect1><title>Device Components</title>
!Esound/core/device.c !Esound/core/device.c
</sect1> </sect1>
<sect1><title>KMOD and Device File Entries</title> <sect1><title>Module requests and Device File Entries</title>
!Esound/core/sound.c !Esound/core/sound.c
</sect1> </sect1>
<sect1><title>Memory Management Helpers</title> <sect1><title>Memory Management Helpers</title>
......
...@@ -305,21 +305,14 @@ driver, like this: ...@@ -305,21 +305,14 @@ driver, like this:
which will result in the needed drivers getting loaded automatically. which will result in the needed drivers getting loaded automatically.
g. if you are planning on using kerneld to automatically load the g. if you are planning on having the kernel automatically request
module for you, then you need to edit /etc/conf.modules and add the the module for you, then you need to edit /etc/conf.modules and add the
following lines: following lines:
options ixj dspio=0x340 xio=0x330 ixjdebug=0 options ixj dspio=0x340 xio=0x330 ixjdebug=0
If you do this, then when you execute an application that uses the If you do this, then when you execute an application that uses the
module kerneld will load the module for you. Note that to do this, module the kernel will request that it is loaded.
you need to have your kernel set to support kerneld. You can check
for this by looking at /usr/src/linux/.config and you should see this:
# Loadable module support
#
<snip>
CONFIG_KMOD=y
h. if you want non-root users to be able to read and write to the h. if you want non-root users to be able to read and write to the
ixj devices (this is a good idea!) you should do the following: ixj devices (this is a good idea!) you should do the following:
......
...@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled. ...@@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
loads that module automatically. This action is performed as loads that module automatically. This action is performed as
once soon as the 'w9968cf' module is loaded into memory. once soon as the 'w9968cf' module is loaded into memory.
Default: 1 Default: 1
Note: The kernel must be compiled with the CONFIG_KMOD option
enabled for the 'ovcamchip' module to be loaded and for
this parameter to be present.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Name: simcams Name: simcams
Type: int Type: int
......
...@@ -873,8 +873,8 @@ config HOTPLUG ...@@ -873,8 +873,8 @@ config HOTPLUG
plugged into slots found on all modern laptop computers. Another plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB. example, used on modern desktops as well as laptops, is USB.
Enable HOTPLUG and KMOD, and build a modular kernel. Get agent Enable HOTPLUG and build a modular kernel. Get agent software
software (at <http://linux-hotplug.sourceforge.net/>) and install it. (from <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them. to use devices as you hotplug them.
......
...@@ -683,9 +683,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, ...@@ -683,9 +683,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
((unsigned long) child_sf) - STACK_BIAS; ((unsigned long) child_sf) - STACK_BIAS;
/* Special case, if we are spawning a kernel thread from /* Special case, if we are spawning a kernel thread from
* a userspace task (via KMOD, NFS, or similar) we must * a userspace task (usermode helper, NFS or similar), we
* disable performance counters in the child because the * must disable performance counters in the child because
* address space and protection realm are changing. * the address space and protection realm are changing.
*/ */
if (t->flags & _TIF_PERFCTR) { if (t->flags & _TIF_PERFCTR) {
t->user_cntd0 = t->user_cntd1 = NULL; t->user_cntd0 = t->user_cntd1 = NULL;
......
...@@ -36,9 +36,6 @@ ...@@ -36,9 +36,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/head.h> #include <asm/head.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include <asm/prom.h> #include <asm/prom.h>
#include "entry.h" #include "entry.h"
......
...@@ -194,8 +194,8 @@ config HOTPLUG ...@@ -194,8 +194,8 @@ config HOTPLUG
plugged into slots found on all modern laptop computers. Another plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB. example, used on modern desktops as well as laptops, is USB.
Enable HOTPLUG and KMOD, and build a modular kernel. Get agent Enable HOTPLUG and build a modular kernel. Get agent software
software (at <http://linux-hotplug.sourceforge.net/>) and install it. (from <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them. to use devices as you hotplug them.
......
...@@ -25,15 +25,16 @@ ...@@ -25,15 +25,16 @@
#define KMOD_PATH_LEN 256 #define KMOD_PATH_LEN 256
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
/* 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(const char * name, ...) __attribute__ ((format (printf, 1, 2))); extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
#else #else
static inline int request_module(const char * name, ...) { return -ENOSYS; } static inline int request_module(const char * name, ...) { return -ENOSYS; }
#define try_then_request_module(x, mod...) (x)
#endif #endif
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
struct key; struct key;
struct file; struct file;
......
...@@ -249,27 +249,30 @@ struct module ...@@ -249,27 +249,30 @@ struct module
/* Exported symbols */ /* Exported symbols */
const struct kernel_symbol *syms; const struct kernel_symbol *syms;
unsigned int num_syms;
const unsigned long *crcs; const unsigned long *crcs;
unsigned int num_syms;
/* GPL-only exported symbols. */ /* GPL-only exported symbols. */
const struct kernel_symbol *gpl_syms;
unsigned int num_gpl_syms; unsigned int num_gpl_syms;
const struct kernel_symbol *gpl_syms;
const unsigned long *gpl_crcs; const unsigned long *gpl_crcs;
#ifdef CONFIG_UNUSED_SYMBOLS
/* unused exported symbols. */ /* unused exported symbols. */
const struct kernel_symbol *unused_syms; const struct kernel_symbol *unused_syms;
unsigned int num_unused_syms;
const unsigned long *unused_crcs; const unsigned long *unused_crcs;
unsigned int num_unused_syms;
/* GPL-only, unused exported symbols. */ /* GPL-only, unused exported symbols. */
const struct kernel_symbol *unused_gpl_syms;
unsigned int num_unused_gpl_syms; unsigned int num_unused_gpl_syms;
const struct kernel_symbol *unused_gpl_syms;
const unsigned long *unused_gpl_crcs; const unsigned long *unused_gpl_crcs;
#endif
/* symbols that will be GPL-only in the near future. */ /* symbols that will be GPL-only in the near future. */
const struct kernel_symbol *gpl_future_syms; const struct kernel_symbol *gpl_future_syms;
unsigned int num_gpl_future_syms;
const unsigned long *gpl_future_crcs; const unsigned long *gpl_future_crcs;
unsigned int num_gpl_future_syms;
/* Exception table */ /* Exception table */
unsigned int num_exentries; unsigned int num_exentries;
...@@ -285,10 +288,10 @@ struct module ...@@ -285,10 +288,10 @@ struct module
void *module_core; void *module_core;
/* Here are the sizes of the init and core sections */ /* Here are the sizes of the init and core sections */
unsigned long init_size, core_size; unsigned int init_size, core_size;
/* The size of the executable code in each section. */ /* The size of the executable code in each section. */
unsigned long init_text_size, core_text_size; unsigned int init_text_size, core_text_size;
/* The handle returned from unwind_add_table. */ /* The handle returned from unwind_add_table. */
void *unwind_info; void *unwind_info;
...@@ -300,29 +303,15 @@ struct module ...@@ -300,29 +303,15 @@ struct module
#ifdef CONFIG_GENERIC_BUG #ifdef CONFIG_GENERIC_BUG
/* Support for BUG */ /* Support for BUG */
unsigned num_bugs;
struct list_head bug_list; struct list_head bug_list;
struct bug_entry *bug_table; struct bug_entry *bug_table;
unsigned num_bugs;
#endif
#ifdef CONFIG_MODULE_UNLOAD
/* Reference counts */
struct module_ref ref[NR_CPUS];
/* What modules depend on me? */
struct list_head modules_which_use_me;
/* Who is waiting for us to be unloaded */
struct task_struct *waiter;
/* Destruction function. */
void (*exit)(void);
#endif #endif
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
/* We keep the symbol and string tables for kallsyms. */ /* We keep the symbol and string tables for kallsyms. */
Elf_Sym *symtab; Elf_Sym *symtab;
unsigned long num_symtab; unsigned int num_symtab;
char *strtab; char *strtab;
/* Section attributes */ /* Section attributes */
...@@ -342,6 +331,21 @@ struct module ...@@ -342,6 +331,21 @@ struct module
struct marker *markers; struct marker *markers;
unsigned int num_markers; unsigned int num_markers;
#endif #endif
#ifdef CONFIG_MODULE_UNLOAD
/* What modules depend on me? */
struct list_head modules_which_use_me;
/* Who is waiting for us to be unloaded */
struct task_struct *waiter;
/* Destruction function. */
void (*exit)(void);
/* Reference counts */
struct module_ref ref[NR_CPUS];
#endif
}; };
#ifndef MODULE_ARCH_INIT #ifndef MODULE_ARCH_INIT
#define MODULE_ARCH_INIT {} #define MODULE_ARCH_INIT {}
......
...@@ -856,8 +856,8 @@ config MODULE_UNLOAD ...@@ -856,8 +856,8 @@ config MODULE_UNLOAD
help help
Without this option you will not be able to unload any Without this option you will not be able to unload any
modules (note that some modules may not be unloadable modules (note that some modules may not be unloadable
anyway), which makes your kernel slightly smaller and anyway), which makes your kernel smaller, faster
simpler. If unsure, say Y. and simpler. If unsure, say Y.
config MODULE_FORCE_UNLOAD config MODULE_FORCE_UNLOAD
bool "Forced module unloading" bool "Forced module unloading"
...@@ -893,16 +893,11 @@ config MODULE_SRCVERSION_ALL ...@@ -893,16 +893,11 @@ config MODULE_SRCVERSION_ALL
will be created for all modules. If unsure, say N. will be created for all modules. If unsure, say N.
config KMOD config KMOD
bool "Automatic kernel module loading" def_bool y
depends on MODULES depends on MODULES
help help
Normally when you have selected some parts of the kernel to This is being removed soon. These days, CONFIG_MODULES
be created as kernel modules, you must load them (using the implies CONFIG_KMOD, so use that instead.
"modprobe" command) before you can use them. If you say Y
here, some parts of the kernel will be able to load modules
automatically: when a part of the kernel needs a module, it
runs modprobe with the appropriate arguments, thereby
loading the module if it is available. If unsure, say Y.
config STOP_MACHINE config STOP_MACHINE
bool bool
......
...@@ -65,7 +65,7 @@ lookup_exec_domain(u_long personality) ...@@ -65,7 +65,7 @@ lookup_exec_domain(u_long personality)
goto out; goto out;
} }
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
read_unlock(&exec_domains_lock); read_unlock(&exec_domains_lock);
request_module("personality-%ld", pers); request_module("personality-%ld", pers);
read_lock(&exec_domains_lock); read_lock(&exec_domains_lock);
......
...@@ -42,7 +42,7 @@ extern int max_threads; ...@@ -42,7 +42,7 @@ extern int max_threads;
static struct workqueue_struct *khelper_wq; static struct workqueue_struct *khelper_wq;
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
/* /*
modprobe_path is set via /proc/sys. modprobe_path is set via /proc/sys.
......
This diff is collapsed.
...@@ -110,7 +110,7 @@ static int min_percpu_pagelist_fract = 8; ...@@ -110,7 +110,7 @@ static int min_percpu_pagelist_fract = 8;
static int ngroups_max = NGROUPS_MAX; static int ngroups_max = NGROUPS_MAX;
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
extern char modprobe_path[]; extern char modprobe_path[];
#endif #endif
#ifdef CONFIG_CHR_DEV_SG #ifdef CONFIG_CHR_DEV_SG
...@@ -475,7 +475,7 @@ static struct ctl_table kern_table[] = { ...@@ -475,7 +475,7 @@ static struct ctl_table kern_table[] = {
.proc_handler = &ftrace_enable_sysctl, .proc_handler = &ftrace_enable_sysctl,
}, },
#endif #endif
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
{ {
.ctl_name = KERN_MODPROBE, .ctl_name = KERN_MODPROBE,
.procname = "modprobe", .procname = "modprobe",
......
...@@ -267,7 +267,7 @@ struct ts_config *textsearch_prepare(const char *algo, const void *pattern, ...@@ -267,7 +267,7 @@ struct ts_config *textsearch_prepare(const char *algo, const void *pattern,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
ops = lookup_ts_algo(algo); ops = lookup_ts_algo(algo);
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
/* /*
* Why not always autoload you may ask. Some users are * Why not always autoload you may ask. Some users are
* in a situation where requesting a module may deadlock, * in a situation where requesting a module may deadlock,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment