summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_kern.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-04-18 21:21:26 +0000
committerphk <phk@FreeBSD.org>2005-04-18 21:21:26 +0000
commitb7f29c0fc0b1ddd6e927c22526ba675066d88be3 (patch)
tree92118bfcb3b51214d76b58ed0679a15b447f60e1 /sys/geom/geom_kern.c
parent4bd811c8dd42f8aa4e81dbf1c945e21e08bb4cd1 (diff)
downloadFreeBSD-src-b7f29c0fc0b1ddd6e927c22526ba675066d88be3.zip
FreeBSD-src-b7f29c0fc0b1ddd6e927c22526ba675066d88be3.tar.gz
Add a named reference-count KPI to hold off mounting of the root filesystem.
While we wait for holds to be released, print a list of who holds us back once per second. Use the new KPI from GEOM instead of vfs_mount.c calling g_waitidle(). Use the new KPI also from ata. With ATAmkIII's newbusification, ata could narrowly miss the window and ad0 would not exist when we tried to mount root.
Diffstat (limited to 'sys/geom/geom_kern.c')
-rw-r--r--sys/geom/geom_kern.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/geom_kern.c b/sys/geom/geom_kern.c
index 1308799..29080e9 100644
--- a/sys/geom/geom_kern.c
+++ b/sys/geom/geom_kern.c
@@ -132,13 +132,19 @@ g_event_procbody(void)
{
struct proc *p = g_event_proc;
struct thread *tp = FIRST_THREAD_IN_PROC(p);
+ struct root_hold_token *t;
mtx_assert(&Giant, MA_NOTOWNED);
mtx_lock_spin(&sched_lock);
sched_prio(tp, PRIBIO);
mtx_unlock_spin(&sched_lock);
+ t = root_mount_hold("GEOM");
for(;;) {
g_run_events();
+ if (t != 0) {
+ root_mount_rel(t);
+ t = NULL;
+ }
tsleep(&g_wait_event, PRIBIO, "-", hz/10);
}
}
OpenPOWER on IntegriCloud