summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-03-27 03:52:08 +0000
committerthompsa <thompsa@FreeBSD.org>2009-03-27 03:52:08 +0000
commit8caa2c2d5c95629f184b384623a877a8bb40a8b7 (patch)
tree1fc4502dff85cf6a7853d0c6fbd03bab3c7ee0eb /sys/kern
parentba46cd63d89446a7c0036dd854b14ddd339a58e3 (diff)
downloadFreeBSD-src-8caa2c2d5c95629f184b384623a877a8bb40a8b7.zip
FreeBSD-src-8caa2c2d5c95629f184b384623a877a8bb40a8b7.tar.gz
Skip the allocation of the root hold token if the mount already happened.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_mount.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index e489d80..9253aff 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1357,6 +1357,9 @@ root_mount_hold(const char *identifier)
{
struct root_hold_token *h;
+ if (root_mounted())
+ return (NULL);
+
h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
h->who = identifier;
mtx_lock(&mountlist_mtx);
@@ -1372,6 +1375,8 @@ void
root_mount_rel(struct root_hold_token *h)
{
+ if (h == NULL)
+ return;
mtx_lock(&mountlist_mtx);
LIST_REMOVE(h, list);
wakeup(&root_holds);
OpenPOWER on IntegriCloud