From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 20 08:30:33 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 05DC9CCE; Wed, 20 Mar 2013 08:30:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 05EE5382; Wed, 20 Mar 2013 08:30:31 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA27157; Wed, 20 Mar 2013 10:30:30 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UIEPm-000NHo-5e; Wed, 20 Mar 2013 10:30:30 +0200 Message-ID: <514973A3.9030706@FreeBSD.org> Date: Wed, 20 Mar 2013 10:30:27 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: FreeBSD Current , freebsd-hackers@FreeBSD.org Subject: mountroot event X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 08:30:33 -0000 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 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