Pass root device as a parameter to domountroothook().

This commit is contained in:
pooka 2010-01-31 02:04:43 +00:00
parent e93a6edc86
commit 3cba324816
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_main.c,v 1.415 2010/01/31 00:43:37 hubertf Exp $ */
/* $NetBSD: init_main.c,v 1.416 2010/01/31 02:04:43 pooka Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -97,7 +97,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.415 2010/01/31 00:43:37 hubertf Exp $");
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.416 2010/01/31 02:04:43 pooka Exp $");
#include "opt_ddb.h"
#include "opt_ipsec.h"
@ -349,7 +349,7 @@ main(void)
bpf_setops();
/* Start module system. */
module_init();
module_init(true);
/*
* Initialize the kernel authorization subsystem and start the
@ -619,7 +619,7 @@ main(void)
/* Mount the root file system. */
do {
domountroothook();
domountroothook(root_device);
if ((error = vfs_mountroot())) {
printf("cannot mount root, error = %d\n", error);
boothowto |= RB_ASKNAME;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_hook.c,v 1.1 2010/01/31 01:38:48 pooka Exp $ */
/* $NetBSD: kern_hook.c,v 1.2 2010/01/31 02:04:43 pooka Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.1 2010/01/31 01:38:48 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.2 2010/01/31 02:04:43 pooka Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -183,12 +183,12 @@ mountroothook_destroy(void)
}
void
domountroothook(void)
domountroothook(struct device *therootdev)
{
struct hook_desc *hd;
LIST_FOREACH(hd, &mountroothook_list, hk_list) {
if (hd->hk_arg == (void *)root_device) {
if (hd->hk_arg == therootdev) {
(*hd->hk_fn)(hd->hk_arg);
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: systm.h,v 1.238 2009/12/13 04:47:45 matt Exp $ */
/* $NetBSD: systm.h,v 1.239 2010/01/31 02:04:43 pooka Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@ -360,7 +360,7 @@ extern const char *rootfstype;
void *mountroothook_establish(void (*)(struct device *), struct device *);
void mountroothook_disestablish(void *);
void mountroothook_destroy(void);
void domountroothook(void);
void domountroothook(struct device *);
/*
* Exec hooks. Subsystems may want to do cleanup when a process