Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Rather than referring a global variable rootvnode i...



details:   https://anonhg.NetBSD.org/src/rev/1401b34de959
branches:  trunk
changeset: 755873:1401b34de959
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jun 26 06:43:13 2010 +0000

description:
Rather than referring a global variable rootvnode in autoconf(9),
prepare and use an internal "root_is_mounted" flag for config_mountroot(9).

Should fix annoying dependency problem in librump reported by Paul Goyette
on current-users@:
http://mail-index.NetBSD.org/current-users/2010/06/25/msg013771.html

diffstat:

 sys/kern/subr_autoconf.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r 2ed21313cb78 -r 1401b34de959 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Sat Jun 26 03:49:52 2010 +0000
+++ b/sys/kern/subr_autoconf.c  Sat Jun 26 06:43:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.208 2010/06/26 06:43:13 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.208 2010/06/26 06:43:13 tsutsui Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -98,7 +98,6 @@
 #include <sys/kthread.h>
 #include <sys/buf.h>
 #include <sys/dirent.h>
-#include <sys/vnode.h>
 #include <sys/mount.h>
 #include <sys/namei.h>
 #include <sys/unistd.h>
@@ -203,6 +202,7 @@
 struct deferred_config_head mountroot_config_queue =
        TAILQ_HEAD_INITIALIZER(mountroot_config_queue);
 int mountroot_config_threads = 2;
+static bool root_is_mounted = false;
 
 static void config_process_deferred(struct deferred_config_head *, device_t);
 
@@ -476,6 +476,9 @@
 {
        int i;
 
+       if (!root_is_mounted)
+               root_is_mounted = true;
+
        for (i = 0; i < mountroot_config_threads; i++) {
                (void)kthread_create(PRI_NONE, 0, NULL,
                    config_mountroot_thread, NULL, NULL, "config");
@@ -1887,7 +1890,7 @@
        /*
         * If root file system is mounted, callback now.
         */
-       if (rootvnode != NULL) {
+       if (root_is_mounted) {
                (*func)(dev);
                return;
        }



Home | Main Index | Thread Index | Old Index