Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2013 10:30:27 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        FreeBSD Current <freebsd-current@FreeBSD.org>, freebsd-hackers@FreeBSD.org
Subject:   mountroot event
Message-ID:  <514973A3.9030706@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

I would like to propose the following change.

My understanding is that it was never a true intention to post 'mountroot' event
on every set_rootvnode() call, but rather an accident in the original commit.
But I could be wrong here.  In either case I think that it is more appropriate
to post the event only once.  I do not expect that there could be any consumers
interested in all the details of root fs manipulations.

It looks like there is just a single subscriber to this event in
subr_firmware.c.  I am not familiar with that code, so I would like to ask for
confirmation that the proposed change won't break anything there.

Thank you.

commit 9dc8eaa50afa6ac88c44fbaad82509721e106f1a
Author: Andriy Gapon <avg@icyb.net.ua>
Date:   Wed Mar 6 08:57:35 2013 +0200

    post mountroot event after a real/final root is mounted

    not every time an intermediate root (including the first devfs) is mounted.

diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index 147926e..162738d 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -199,8 +199,6 @@ set_rootvnode(void)
 	VREF(rootvnode);

 	FILEDESC_XUNLOCK(p->p_fd);
-
-	EVENTHANDLER_INVOKE(mountroot);
 }

 static int
@@ -991,6 +989,8 @@ vfs_mountroot(void)
 	atomic_store_rel_int(&root_mount_complete, 1);
 	wakeup(&root_mount_complete);
 	mtx_unlock(&mountlist_mtx);
+
+	EVENTHANDLER_INVOKE(mountroot);
 }

 static struct mntarg *

-- 
Andriy Gapon



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