diff --git a/sys/geom/geom_int.h b/sys/geom/geom_int.h index 0a827affc44..149a283c656 100644 --- a/sys/geom/geom_int.h +++ b/sys/geom/geom_int.h @@ -75,6 +75,7 @@ void g_io_schedule_up(struct thread *tp); /* geom_kern.c / geom_kernsim.c */ void g_init(void); extern int g_shutdown; +extern int g_notaste; /* geom_ctl.c */ void g_ctl_init(void); diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c index 1744d170160..2e65bfbcd9b 100644 --- a/sys/geom/geom_kern.c +++ b/sys/geom/geom_kern.c @@ -66,6 +66,7 @@ static struct thread *g_event_td; int g_debugflags; int g_collectstats = 1; int g_shutdown; +int g_notaste; /* * G_UP and G_DOWN are the two threads which push I/O through the @@ -208,6 +209,9 @@ TUNABLE_INT("kern.geom.debugflags", &g_debugflags); SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RW, &g_debugflags, 0, "Set various trace levels for GEOM debugging"); +SYSCTL_INT(_kern_geom, OID_AUTO, notaste, CTLFLAG_RW, + &g_notaste, 0, "Prevent GEOM tasting"); + SYSCTL_INT(_kern_geom, OID_AUTO, collectstats, CTLFLAG_RW, &g_collectstats, 0, "Control statistics collection on GEOM providers and consumers"); diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 316e66635fe..ecbf0b811d9 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -271,7 +271,7 @@ g_retaste_event(void *arg, int flag) g_topology_assert(); if (flag == EV_CANCEL) /* XXX: can't happen ? */ return; - if (g_shutdown) + if (g_shutdown || g_notaste) return; hh = arg; @@ -540,6 +540,8 @@ g_new_provider_event(void *arg, int flag) cp->geom->attrchanged != NULL) cp->geom->attrchanged(cp, "GEOM::media"); } + if (g_notaste) + return; LIST_FOREACH(mp, &g_classes, class) { if (mp->taste == NULL) continue;