diff options
author | phk <phk@FreeBSD.org> | 2003-04-23 19:15:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-23 19:15:27 +0000 |
commit | 51e68a1f271b78912e5111996bb20d0b58350244 (patch) | |
tree | f4f7caeac923a9eeae6ae7aa81cedb35279ae8c7 /sys/geom/geom_kern.c | |
parent | fe0dcbf0db6c0773fb4a038a294c002df7c24c2c (diff) | |
download | FreeBSD-src-51e68a1f271b78912e5111996bb20d0b58350244.zip FreeBSD-src-51e68a1f271b78912e5111996bb20d0b58350244.tar.gz |
Move the shutdown eventhandler stuff to a more logical place.
Diffstat (limited to 'sys/geom/geom_kern.c')
-rw-r--r-- | sys/geom/geom_kern.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 0c2029d..d7eef7e 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -38,6 +38,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/eventhandler.h> #include <sys/malloc.h> #include <sys/bio.h> #include <sys/sysctl.h> @@ -58,6 +59,7 @@ static struct proc *g_up_proc; int g_debugflags; int g_collectstats = 1; +int g_shutdown; /* * G_UP and G_DOWN are the two threads which push I/O through the @@ -139,6 +141,13 @@ struct kproc_desc g_event_kp = { &g_event_proc, }; +static void +geom_shutdown(void *foo __unused) +{ + + g_shutdown = 1; +} + void g_init(void) { @@ -151,6 +160,8 @@ g_init(void) kproc_start(&g_up_kp); kproc_start(&g_down_kp); mtx_unlock(&Giant); + EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL, + SHUTDOWN_PRI_FIRST); } static int |