svn commit: r216042 - stable/8/sys/kern
Attilio Rao
attilio at FreeBSD.org
Mon Nov 29 08:04:11 UTC 2010
Author: attilio
Date: Mon Nov 29 08:04:10 2010
New Revision: 216042
URL: http://svn.freebsd.org/changeset/base/216042
Log:
MFC r215544,215683:
Scan the list in reverse order for the shutdown handlers of loaded modules.
This way, when there is a dependency between two modules, the handler of the
latter probed runs first.
Sponsored by: Sandvine Incorporated
Modified:
stable/8/sys/kern/kern_module.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/kern/kern_module.c
==============================================================================
--- stable/8/sys/kern/kern_module.c Mon Nov 29 06:50:30 2010 (r216041)
+++ stable/8/sys/kern/kern_module.c Mon Nov 29 08:04:10 2010 (r216042)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
static MALLOC_DEFINE(M_MODULE, "module", "module data structures");
-typedef TAILQ_HEAD(, module) modulelist_t;
struct module {
TAILQ_ENTRY(module) link; /* chain together all modules */
TAILQ_ENTRY(module) flink; /* all modules in a file */
@@ -61,7 +60,7 @@ struct module {
#define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
-static modulelist_t modules;
+static TAILQ_HEAD(modulelist, module) modules;
struct sx modules_sx;
static int nextid = 1;
static void module_shutdown(void *, int);
@@ -101,7 +100,7 @@ module_shutdown(void *arg1, int arg2)
return;
mtx_lock(&Giant);
MOD_SLOCK;
- TAILQ_FOREACH(mod, &modules, link)
+ TAILQ_FOREACH_REVERSE(mod, &modules, modulelist, link)
MOD_EVENT(mod, MOD_SHUTDOWN);
MOD_SUNLOCK;
mtx_unlock(&Giant);
More information about the svn-src-stable
mailing list