summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-04-08 23:54:01 +0000
committerpjd <pjd@FreeBSD.org>2007-04-08 23:54:01 +0000
commit6f7c2e9be332701e0413b3b132f1ad7dcb450306 (patch)
treefcabd1eafcf591c83dba7cfa7c7c8d2beea65a4f /sys/kern
parent47ca069c43c45019e40fe40b2115caab4bc256c6 (diff)
downloadFreeBSD-src-6f7c2e9be332701e0413b3b132f1ad7dcb450306.zip
FreeBSD-src-6f7c2e9be332701e0413b3b132f1ad7dcb450306.tar.gz
Add root_mounted() function that returns true if the root file system is
already mounted.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_mount.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index cb556a2..b7dec78 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1383,6 +1383,20 @@ root_mount_done(void)
mtx_unlock(&mountlist_mtx);
}
+ /*
+ * Return true if root is already mounted.
+ */
+int
+root_mounted(void)
+{
+ int mounted;
+
+ mtx_lock(&mountlist_mtx);
+ mounted = root_mount_complete;
+ mtx_unlock(&mountlist_mtx);
+ return (mounted);
+}
+
/*
* Wait until root is mounted.
*/
OpenPOWER on IntegriCloud