summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-04-19 21:44:44 +0000
committerpjd <pjd@FreeBSD.org>2005-04-19 21:44:44 +0000
commitdb9ce4609f5c2cf9baa552a61c8c12a3c27b113b (patch)
tree18279ad554c3feeeebe926f101b25583405ea9d5 /sys
parentb98f7a40836f1e1b7859ba2313290f3941754f7f (diff)
downloadFreeBSD-src-db9ce4609f5c2cf9baa552a61c8c12a3c27b113b.zip
FreeBSD-src-db9ce4609f5c2cf9baa552a61c8c12a3c27b113b.tar.gz
Call g_waitidle() before every check the list of holds is empty.
Suggested by: phk
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_mount.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index b0d8234..0f800c4 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1041,15 +1041,22 @@ root_mount_wait(void)
{
struct root_hold_token *h;
- mtx_lock(&mountlist_mtx);
- while (!LIST_EMPTY(&root_holds)) {
+ for (;;) {
+ DROP_GIANT();
+ g_waitidle();
+ PICKUP_GIANT();
+ mtx_lock(&mountlist_mtx);
+ if (LIST_EMPTY(&root_holds)) {
+ mtx_unlock(&mountlist_mtx);
+ break;
+ }
printf("Root mount waiting for:");
LIST_FOREACH(h, &root_holds, list)
printf(" %s", h->who);
printf("\n");
- msleep(&root_holds, &mountlist_mtx, PZERO, "roothold", hz);
+ msleep(&root_holds, &mountlist_mtx, PZERO | PDROP, "roothold",
+ hz);
}
- mtx_unlock(&mountlist_mtx);
}
static void
@@ -1189,9 +1196,6 @@ vfs_mountroot(void)
struct mount *mp;
root_mount_wait();
- DROP_GIANT();
- g_waitidle();
- PICKUP_GIANT();
mp = devfs_first();
OpenPOWER on IntegriCloud