Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Mar 2009 03:52:08 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190460 - head/sys/kern
Message-ID:  <200903270352.n2R3q8Qb047224@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Fri Mar 27 03:52:08 2009
New Revision: 190460
URL: http://svn.freebsd.org/changeset/base/190460

Log:
  Skip the allocation of the root hold token if the mount already happened.

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Fri Mar 27 03:45:42 2009	(r190459)
+++ head/sys/kern/vfs_mount.c	Fri Mar 27 03:52:08 2009	(r190460)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903270352.n2R3q8Qb047224>