Move the shutdown eventhandler stuff to a more logical place.
This commit is contained in:
parent
fe0dcbf0db
commit
51e68a1f27
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user