vfs_mount.c (31016) | vfs_mount.c (31403) |
---|---|
1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1995 Artisoft, Inc. All Rights Reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 | 1/* 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 1995 Artisoft, Inc. All Rights Reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94 |
35 * $Id: vfs_conf.c,v 1.16 1997/10/16 07:32:14 julian Exp $ | 35 * $Id: vfs_conf.c,v 1.17 1997/11/07 08:53:10 phk Exp $ |
36 */ 37 38/* 39 * PURPOSE: This file abstracts the root mounting interface from 40 * the per file system semantics for handling mounts, 41 * the overall intent of which is to move the BSD 42 * internals dependence out of the FS code, both to 43 * make the FS code more portable and to free up some 44 * of the BSD internals so that they may more easily 45 * be changed. 46 * 47 * NOTE1: Code is single entry/single exit to aid debugging 48 * and conversion for kernel multithreading. 49 * 50 * NOTE2: Code notes lock state in headers on entry and exit 51 * as an aid to conversion for kernel multithreading 52 * on SMP reentrancy 53 */ 54#include <sys/param.h> /* dev_t (types.h)*/ | 36 */ 37 38/* 39 * PURPOSE: This file abstracts the root mounting interface from 40 * the per file system semantics for handling mounts, 41 * the overall intent of which is to move the BSD 42 * internals dependence out of the FS code, both to 43 * make the FS code more portable and to free up some 44 * of the BSD internals so that they may more easily 45 * be changed. 46 * 47 * NOTE1: Code is single entry/single exit to aid debugging 48 * and conversion for kernel multithreading. 49 * 50 * NOTE2: Code notes lock state in headers on entry and exit 51 * as an aid to conversion for kernel multithreading 52 * on SMP reentrancy 53 */ 54#include <sys/param.h> /* dev_t (types.h)*/ |
55#include <sys/kernel.h> |
|
55#include <sys/systm.h> /* rootvp*/ 56#include <sys/proc.h> /* curproc*/ 57#include <sys/vnode.h> /* NULLVP*/ 58#include <sys/mount.h> /* struct mount*/ 59#include <sys/malloc.h> /* M_MOUNT*/ 60 61/* 62 * GLOBALS --- 37 unchanged lines hidden (view full) --- 100 * EXIT 101 * <no locks held> 102 * 103 * NOTES: 104 * This code is currently supported only for use for 105 * the FFS file system type. This is a matter of 106 * fixing the other file systems, not this code! 107 */ | 56#include <sys/systm.h> /* rootvp*/ 57#include <sys/proc.h> /* curproc*/ 58#include <sys/vnode.h> /* NULLVP*/ 59#include <sys/mount.h> /* struct mount*/ 60#include <sys/malloc.h> /* M_MOUNT*/ 61 62/* 63 * GLOBALS --- 37 unchanged lines hidden (view full) --- 101 * EXIT 102 * <no locks held> 103 * 104 * NOTES: 105 * This code is currently supported only for use for 106 * the FFS file system type. This is a matter of 107 * fixing the other file systems, not this code! 108 */ |
108int | 109static int |
109vfs_mountrootfs(fsname) 110 char *fsname; 111{ 112 struct mount *mp; 113 int err = 0; 114 struct proc *p = curproc; /* XXX */ 115 116 /* --- 29 unchanged lines hidden (view full) --- 146 vfs_unbusy(mp, p); 147 148 /* free mount struct before failing*/ 149 free( mp, M_MOUNT); 150 151success: 152 return( err); 153} | 110vfs_mountrootfs(fsname) 111 char *fsname; 112{ 113 struct mount *mp; 114 int err = 0; 115 struct proc *p = curproc; /* XXX */ 116 117 /* --- 29 unchanged lines hidden (view full) --- 147 vfs_unbusy(mp, p); 148 149 /* free mount struct before failing*/ 150 free( mp, M_MOUNT); 151 152success: 153 return( err); 154} |
155 156/* ARGSUSED*/ 157static void xxx_vfs_mountroot __P((void *fsnamep)); 158#ifdef BOOTP 159extern void bootpc_init __P((void)); 160#endif 161static void 162xxx_vfs_mountroot(fsnamep) 163 void *fsnamep; 164{ 165 /* XXX Add a separate SYSINIT entry */ 166#ifdef BOOTP 167 bootpc_init(); 168#endif 169 /* Mount the root file system. */ 170 if (vfs_mountrootfs(*((char **) fsnamep))) 171 panic("cannot mount root"); 172} 173SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot, 174 &mountrootfsname) 175 |
|