(unknown charset) mountroot event

From: (unknown charset) Andriy Gapon <avg_at_FreeBSD.org>
Date: Wed, 20 Mar 2013 10:30:27 +0200
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_at_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
_at__at_ -199,8 +199,6 _at__at_ set_rootvnode(void)
 	VREF(rootvnode);

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

 static int
_at__at_ -991,6 +989,8 _at__at_ 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
Received on Wed Mar 20 2013 - 07:30:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:35 UTC