Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-f…
Browse files Browse the repository at this point in the history
…or-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
  • Loading branch information
Linus Torvalds committed Jul 22, 2008
2 parents 06b8147 + a1ef5ad commit 6eaaaac
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 202 deletions.
10 changes: 5 additions & 5 deletions Documentation/filesystems/bfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ You can simplify mounting by just typing:

this will allocate the first available loopback device (and load loop.o
kernel module if necessary) automatically. If the loopback driver is not
loaded automatically, make sure that your kernel is compiled with kmod
support (CONFIG_KMOD) enabled. Beware that umount will not
deallocate /dev/loopN device if /etc/mtab file on your system is a
symbolic link to /proc/mounts. You will need to do it manually using
"-d" switch of losetup(8). Read losetup(8) manpage for more info.
loaded automatically, make sure that you have compiled the module and
that modprobe is functioning. Beware that umount will not deallocate
/dev/loopN device if /etc/mtab file on your system is a symbolic link to
/proc/mounts. You will need to do it manually using "-d" switch of
losetup(8). Read losetup(8) manpage for more info.

To create the BFS image under UnixWare you need to find out first which
slice contains it. The command prtvtoc(1M) is your friend:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<sect1><title>Device Components</title>
!Esound/core/device.c
</sect1>
<sect1><title>KMOD and Device File Entries</title>
<sect1><title>Module requests and Device File Entries</title>
!Esound/core/sound.c
</sect1>
<sect1><title>Memory Management Helpers</title>
Expand Down
13 changes: 3 additions & 10 deletions Documentation/telephony/ixj.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,14 @@ driver, like this:

which will result in the needed drivers getting loaded automatically.

g. if you are planning on using kerneld to automatically load the
module for you, then you need to edit /etc/conf.modules and add the
g. if you are planning on having the kernel automatically request
the module for you, then you need to edit /etc/conf.modules and add the
following lines:

options ixj dspio=0x340 xio=0x330 ixjdebug=0

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,
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
module the kernel will request that it is loaded.

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:
Expand Down
3 changes: 0 additions & 3 deletions Documentation/video4linux/w9968cf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
loads that module automatically. This action is performed as
once soon as the 'w9968cf' module is loaded into memory.
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
Type: int
Expand Down
4 changes: 2 additions & 2 deletions arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,8 @@ config HOTPLUG
plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB.

Enable HOTPLUG and KMOD, and build a modular kernel. Get agent
software (at <http://linux-hotplug.sourceforge.net/>) and install it.
Enable HOTPLUG and build a modular kernel. Get agent software
(from <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them.
Expand Down
6 changes: 3 additions & 3 deletions arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
((unsigned long) child_sf) - STACK_BIAS;

/* Special case, if we are spawning a kernel thread from
* a userspace task (via KMOD, NFS, or similar) we must
* disable performance counters in the child because the
* address space and protection realm are changing.
* a userspace task (usermode helper, NFS or similar), we
* must disable performance counters in the child because
* the address space and protection realm are changing.
*/
if (t->flags & _TIF_PERFCTR) {
t->user_cntd0 = t->user_cntd1 = NULL;
Expand Down
3 changes: 0 additions & 3 deletions arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#include <asm/processor.h>
#include <asm/timer.h>
#include <asm/head.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include <asm/prom.h>

#include "entry.h"
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ config HOTPLUG
plugged into slots found on all modern laptop computers. Another
example, used on modern desktops as well as laptops, is USB.

Enable HOTPLUG and KMOD, and build a modular kernel. Get agent
software (at <http://linux-hotplug.sourceforge.net/>) and install it.
Enable HOTPLUG and build a modular kernel. Get agent software
(from <http://linux-hotplug.sourceforge.net/>) and install it.
Then your kernel will automatically call out to a user mode "policy
agent" (/sbin/hotplug) to load modules and set up software needed
to use devices as you hotplug them.
Expand Down
5 changes: 3 additions & 2 deletions include/linux/kmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@

#define KMOD_PATH_LEN 256

#ifdef CONFIG_KMOD
#ifdef CONFIG_MODULES
/* modprobe exit status on success, -ve on error. Return value
* usually useless though. */
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
static inline int request_module(const char * name, ...) { return -ENOSYS; }
#define try_then_request_module(x, mod...) (x)
#endif

#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))

struct key;
struct file;
Expand Down
50 changes: 27 additions & 23 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,30 @@ struct module

/* Exported symbols */
const struct kernel_symbol *syms;
unsigned int num_syms;
const unsigned long *crcs;
unsigned int num_syms;

/* GPL-only exported symbols. */
const struct kernel_symbol *gpl_syms;
unsigned int num_gpl_syms;
const struct kernel_symbol *gpl_syms;
const unsigned long *gpl_crcs;

#ifdef CONFIG_UNUSED_SYMBOLS
/* unused exported symbols. */
const struct kernel_symbol *unused_syms;
unsigned int num_unused_syms;
const unsigned long *unused_crcs;
unsigned int num_unused_syms;

/* GPL-only, unused exported symbols. */
const struct kernel_symbol *unused_gpl_syms;
unsigned int num_unused_gpl_syms;
const struct kernel_symbol *unused_gpl_syms;
const unsigned long *unused_gpl_crcs;
#endif

/* symbols that will be GPL-only in the near future. */
const struct kernel_symbol *gpl_future_syms;
unsigned int num_gpl_future_syms;
const unsigned long *gpl_future_crcs;
unsigned int num_gpl_future_syms;

/* Exception table */
unsigned int num_exentries;
Expand All @@ -285,10 +288,10 @@ struct module
void *module_core;

/* 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. */
unsigned long init_text_size, core_text_size;
unsigned int init_text_size, core_text_size;

/* The handle returned from unwind_add_table. */
void *unwind_info;
Expand All @@ -300,29 +303,15 @@ struct module

#ifdef CONFIG_GENERIC_BUG
/* Support for BUG */
unsigned num_bugs;
struct list_head bug_list;
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

#ifdef CONFIG_KALLSYMS
/* We keep the symbol and string tables for kallsyms. */
Elf_Sym *symtab;
unsigned long num_symtab;
unsigned int num_symtab;
char *strtab;

/* Section attributes */
Expand All @@ -342,6 +331,21 @@ struct module
struct marker *markers;
unsigned int num_markers;
#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
#define MODULE_ARCH_INIT {}
Expand Down
15 changes: 5 additions & 10 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ config MODULE_UNLOAD
help
Without this option you will not be able to unload any
modules (note that some modules may not be unloadable
anyway), which makes your kernel slightly smaller and
simpler. If unsure, say Y.
anyway), which makes your kernel smaller, faster
and simpler. If unsure, say Y.

config MODULE_FORCE_UNLOAD
bool "Forced module unloading"
Expand Down Expand Up @@ -893,16 +893,11 @@ config MODULE_SRCVERSION_ALL
will be created for all modules. If unsure, say N.

config KMOD
bool "Automatic kernel module loading"
def_bool y
depends on MODULES
help
Normally when you have selected some parts of the kernel to
be created as kernel modules, you must load them (using the
"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.
This is being removed soon. These days, CONFIG_MODULES
implies CONFIG_KMOD, so use that instead.

config STOP_MACHINE
bool
Expand Down
2 changes: 1 addition & 1 deletion kernel/exec_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ lookup_exec_domain(u_long personality)
goto out;
}

#ifdef CONFIG_KMOD
#ifdef CONFIG_MODULES
read_unlock(&exec_domains_lock);
request_module("personality-%ld", pers);
read_lock(&exec_domains_lock);
Expand Down
2 changes: 1 addition & 1 deletion kernel/kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern int max_threads;

static struct workqueue_struct *khelper_wq;

#ifdef CONFIG_KMOD
#ifdef CONFIG_MODULES

/*
modprobe_path is set via /proc/sys.
Expand Down
Loading

0 comments on commit 6eaaaac

Please sign in to comment.