Module Name: src Committed By: tsutsui Date: Sat Jun 26 06:43:14 UTC 2010
Modified Files: src/sys/kern: subr_autoconf.c Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/sys/kern/subr_autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/subr_autoconf.c diff -u src/sys/kern/subr_autoconf.c:1.207 src/sys/kern/subr_autoconf.c:1.208 --- src/sys/kern/subr_autoconf.c:1.207 Fri Jun 25 15:10:42 2010 +++ src/sys/kern/subr_autoconf.c Sat Jun 26 06:43:13 2010 @@ -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; }