0032-Run-VFS_START-for-the-root-mount-point.patch

ftigeot, 08/28/2011 10:26 AM

Download (1.75 KB)

View differences:

sys/kern/vfs_conf.c
376 376
	char		patt[32];
377 377
	const char	*cp, *ep;
378 378
	char		*mf;
379
	struct proc	*p;
380
	struct vnode	*vp;
379 381

  
380 382
	vfsname = NULL;
381 383
	devname = NULL;
......
449 451

  
450 452
		/* sanity check system clock against root fs timestamp */
451 453
		inittodr(mp->mnt_time);
454

  
455
		/* Get the vnode for '/'.  Set p->p_fd->fd_cdir to reference it. */
456
		mp = mountlist_boot_getfirst();
457
		if (VFS_ROOT(mp, &vp))
458
			panic("cannot find root vnode");
459
		if (mp->mnt_ncmountpt.ncp == NULL) {
460
			cache_allocroot(&mp->mnt_ncmountpt, mp, vp);
461
			cache_unlock(&mp->mnt_ncmountpt);	/* leave ref intact */
462
		}
463
		p = curproc;
464
		p->p_fd->fd_cdir = vp;
465
		vref(p->p_fd->fd_cdir);
466
		p->p_fd->fd_rdir = vp;
467
		vref(p->p_fd->fd_rdir);
468
		vfs_cache_setroot(vp, cache_hold(&mp->mnt_ncmountpt));
469
		vn_unlock(vp);			/* leave ref intact */
470
		cache_copy(&mp->mnt_ncmountpt, &p->p_fd->fd_ncdir);
471
		cache_copy(&mp->mnt_ncmountpt, &p->p_fd->fd_nrdir);
472

  
452 473
		vfs_unbusy(mp);
453 474
		if (mp->mnt_syncer == NULL) {
454 475
			error = vfs_allocate_syncvnode(mp);
......
456 477
				kprintf("Warning: no syncer vp for root!\n");
457 478
			error = 0;
458 479
		}
480
		VFS_START( mp, 0 );
459 481
	} else {
460 482
		if (mp != NULL) {
461 483
			vfs_unbusy(mp);
462
-