init_main.c (88019) | init_main.c (89306) |
---|---|
1/* 2 * Copyright (c) 1995 Terrence R. Lambert 3 * All rights reserved. 4 * 5 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * (c) UNIX System Laboratories, Inc. 8 * All or some portions of this file are derived from material licensed --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)init_main.c 8.9 (Berkeley) 1/21/94 | 1/* 2 * Copyright (c) 1995 Terrence R. Lambert 3 * All rights reserved. 4 * 5 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993 6 * The Regents of the University of California. All rights reserved. 7 * (c) UNIX System Laboratories, Inc. 8 * All or some portions of this file are derived from material licensed --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)init_main.c 8.9 (Berkeley) 1/21/94 |
42 * $FreeBSD: head/sys/kern/init_main.c 88019 2001-12-16 16:07:20Z luigi $ | 42 * $FreeBSD: head/sys/kern/init_main.c 89306 2002-01-13 11:58:06Z alfred $ |
43 */ 44 45#include "opt_init_path.h" 46 47#include <sys/param.h> 48#include <sys/file.h> 49#include <sys/filedesc.h> 50#include <sys/kernel.h> --- 302 unchanged lines hidden (view full) --- 353 p->p_procsig->ps_refcnt = 1; 354 355 /* Initialize signal state for process 0. */ 356 siginit(&proc0); 357 358 /* Create the file descriptor table. */ 359 fdp = &filedesc0; 360 p->p_fd = &fdp->fd_fd; | 43 */ 44 45#include "opt_init_path.h" 46 47#include <sys/param.h> 48#include <sys/file.h> 49#include <sys/filedesc.h> 50#include <sys/kernel.h> --- 302 unchanged lines hidden (view full) --- 353 p->p_procsig->ps_refcnt = 1; 354 355 /* Initialize signal state for process 0. */ 356 siginit(&proc0); 357 358 /* Create the file descriptor table. */ 359 fdp = &filedesc0; 360 p->p_fd = &fdp->fd_fd; |
361 mtx_init(&fdp->fd_fd.fd_mtx, "struct filedesc", MTX_DEF); |
|
361 fdp->fd_fd.fd_refcnt = 1; 362 fdp->fd_fd.fd_cmask = cmask; 363 fdp->fd_fd.fd_ofiles = fdp->fd_dfiles; 364 fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags; 365 fdp->fd_fd.fd_nfiles = NDFILE; 366 367 /* Create the limits structures. */ 368 p->p_limit = &limit0; --- 113 unchanged lines hidden (view full) --- 482 GIANT_REQUIRED; 483 484 td = curthread; 485 p = td->td_proc; 486 487 /* Get the vnode for '/'. Set p->p_fd->fd_cdir to reference it. */ 488 if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode)) 489 panic("cannot find root vnode"); | 362 fdp->fd_fd.fd_refcnt = 1; 363 fdp->fd_fd.fd_cmask = cmask; 364 fdp->fd_fd.fd_ofiles = fdp->fd_dfiles; 365 fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags; 366 fdp->fd_fd.fd_nfiles = NDFILE; 367 368 /* Create the limits structures. */ 369 p->p_limit = &limit0; --- 113 unchanged lines hidden (view full) --- 483 GIANT_REQUIRED; 484 485 td = curthread; 486 p = td->td_proc; 487 488 /* Get the vnode for '/'. Set p->p_fd->fd_cdir to reference it. */ 489 if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode)) 490 panic("cannot find root vnode"); |
491 FILEDESC_LOCK(p->p_fd); |
|
490 p->p_fd->fd_cdir = rootvnode; 491 VREF(p->p_fd->fd_cdir); 492 p->p_fd->fd_rdir = rootvnode; 493 VREF(p->p_fd->fd_rdir); | 492 p->p_fd->fd_cdir = rootvnode; 493 VREF(p->p_fd->fd_cdir); 494 p->p_fd->fd_rdir = rootvnode; 495 VREF(p->p_fd->fd_rdir); |
496 FILEDESC_UNLOCK(p->p_fd); |
|
494 VOP_UNLOCK(rootvnode, 0, td); 495 496 if (devfs_present) { 497 /* 498 * For disk based systems, we probably cannot do this yet 499 * since the fs will be read-only. But a NFS root 500 * might be ok. It is worth a shot. 501 */ --- 148 unchanged lines hidden --- | 497 VOP_UNLOCK(rootvnode, 0, td); 498 499 if (devfs_present) { 500 /* 501 * For disk based systems, we probably cannot do this yet 502 * since the fs will be read-only. But a NFS root 503 * might be ok. It is worth a shot. 504 */ --- 148 unchanged lines hidden --- |