Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_mount.c
Show First 20 Lines • Show All 963 Lines • ▼ Show 20 Lines | vfs_domount_first( | ||||
* Mount the filesystem. | * Mount the filesystem. | ||||
* XXX The final recipients of VFS_MOUNT just overwrite the ndp they | * XXX The final recipients of VFS_MOUNT just overwrite the ndp they | ||||
* get. No freeing of cn_pnbuf. | * get. No freeing of cn_pnbuf. | ||||
*/ | */ | ||||
error1 = 0; | error1 = 0; | ||||
if ((error = VFS_MOUNT(mp)) != 0 || | if ((error = VFS_MOUNT(mp)) != 0 || | ||||
(error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || | (error1 = VFS_STATFS(mp, &mp->mnt_stat)) != 0 || | ||||
(error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { | (error1 = VFS_ROOT(mp, LK_EXCLUSIVE, &newdp)) != 0) { | ||||
rootvp = NULL; | |||||
if (error1 != 0) { | if (error1 != 0) { | ||||
error = error1; | error = error1; | ||||
rootvp = vfs_cache_root_clear(mp); | rootvp = vfs_cache_root_clear(mp); | ||||
if (rootvp != NULL) | if (rootvp != NULL) { | ||||
vhold(rootvp); | |||||
vrele(rootvp); | vrele(rootvp); | ||||
} | |||||
if ((error1 = VFS_UNMOUNT(mp, 0)) != 0) | if ((error1 = VFS_UNMOUNT(mp, 0)) != 0) | ||||
printf("VFS_UNMOUNT returned %d\n", error1); | printf("VFS_UNMOUNT returned %d\n", error1); | ||||
} | } | ||||
vfs_unbusy(mp); | vfs_unbusy(mp); | ||||
mp->mnt_vnodecovered = NULL; | mp->mnt_vnodecovered = NULL; | ||||
vfs_mount_destroy(mp); | vfs_mount_destroy(mp); | ||||
VI_LOCK(vp); | VI_LOCK(vp); | ||||
vp->v_iflag &= ~VI_MOUNT; | vp->v_iflag &= ~VI_MOUNT; | ||||
VI_UNLOCK(vp); | VI_UNLOCK(vp); | ||||
if (rootvp != NULL) { | |||||
vn_seqc_write_end(rootvp); | |||||
vdrop(rootvp); | |||||
} | |||||
vn_seqc_write_end(vp); | vn_seqc_write_end(vp); | ||||
vrele(vp); | vrele(vp); | ||||
return (error); | return (error); | ||||
} | } | ||||
vn_seqc_write_begin(newdp); | vn_seqc_write_begin(newdp); | ||||
VOP_UNLOCK(newdp); | VOP_UNLOCK(newdp); | ||||
if (mp->mnt_opt != NULL) | if (mp->mnt_opt != NULL) | ||||
▲ Show 20 Lines • Show All 1,510 Lines • Show Last 20 Lines |