summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-23 19:15:27 +0000
committerphk <phk@FreeBSD.org>2003-04-23 19:15:27 +0000
commit51e68a1f271b78912e5111996bb20d0b58350244 (patch)
treef4f7caeac923a9eeae6ae7aa81cedb35279ae8c7 /sys/geom
parentfe0dcbf0db6c0773fb4a038a294c002df7c24c2c (diff)
downloadFreeBSD-src-51e68a1f271b78912e5111996bb20d0b58350244.zip
FreeBSD-src-51e68a1f271b78912e5111996bb20d0b58350244.tar.gz
Move the shutdown eventhandler stuff to a more logical place.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_event.c11
-rw-r--r--sys/geom/geom_int.h1
-rw-r--r--sys/geom/geom_kern.c11
3 files changed, 12 insertions, 11 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index 41d9ab5..16c005f 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -46,7 +46,6 @@
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
-#include <sys/eventhandler.h>
#include <machine/stdarg.h>
#include <sys/errno.h>
#include <sys/time.h>
@@ -59,7 +58,6 @@ static void g_do_event(struct g_event *ep);
static TAILQ_HEAD(,g_provider) g_doorstep = TAILQ_HEAD_INITIALIZER(g_doorstep);
static struct mtx g_eventlock;
static struct sx g_eventstall;
-static int g_shutdown;
void
g_waitidle(void)
@@ -348,20 +346,11 @@ g_call_me(g_call_me_t *func, void *arg, ...)
return (0);
}
-static void
-geom_shutdown(void *foo __unused)
-{
-
- g_shutdown = 1;
-}
void
g_event_init()
{
-
- EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL,
- SHUTDOWN_PRI_FIRST);
mtx_init(&g_eventlock, "GEOM orphanage", NULL, MTX_DEF);
sx_init(&g_eventstall, "GEOM event stalling");
}
diff --git a/sys/geom/geom_int.h b/sys/geom/geom_int.h
index 0f9695c..fe6f5c7 100644
--- a/sys/geom/geom_int.h
+++ b/sys/geom/geom_int.h
@@ -108,6 +108,7 @@ void g_io_schedule_up(struct thread *tp);
/* geom_kern.c / geom_kernsim.c */
void g_init(void);
+extern int g_shutdown;
/* geom_ctl.c */
void g_ctl_init(void);
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
OpenPOWER on IntegriCloud