Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_mount.c
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, const char *fspath, | ||||
bzero(&mp->mnt_startzero, | bzero(&mp->mnt_startzero, | ||||
__rangeof(struct mount, mnt_startzero, mnt_endzero)); | __rangeof(struct mount, mnt_startzero, mnt_endzero)); | ||||
TAILQ_INIT(&mp->mnt_nvnodelist); | TAILQ_INIT(&mp->mnt_nvnodelist); | ||||
mp->mnt_nvnodelistsize = 0; | mp->mnt_nvnodelistsize = 0; | ||||
TAILQ_INIT(&mp->mnt_activevnodelist); | TAILQ_INIT(&mp->mnt_activevnodelist); | ||||
mp->mnt_activevnodelistsize = 0; | mp->mnt_activevnodelistsize = 0; | ||||
TAILQ_INIT(&mp->mnt_tmpfreevnodelist); | TAILQ_INIT(&mp->mnt_tmpfreevnodelist); | ||||
mp->mnt_tmpfreevnodelistsize = 0; | mp->mnt_tmpfreevnodelistsize = 0; | ||||
TAILQ_INIT(&mp->mnt_lazyvnodelist); | |||||
mp->mnt_lazyvnodelistsize = 0; | |||||
if (mp->mnt_ref != 0 || mp->mnt_lockref != 0 || | if (mp->mnt_ref != 0 || mp->mnt_lockref != 0 || | ||||
mp->mnt_writeopcount != 0) | mp->mnt_writeopcount != 0) | ||||
panic("%s: non-zero counters on new mp %p\n", __func__, mp); | panic("%s: non-zero counters on new mp %p\n", __func__, mp); | ||||
if (mp->mnt_vfs_ops != 1) | if (mp->mnt_vfs_ops != 1) | ||||
panic("%s: vfs_ops should be 1 but %d found\n", __func__, | panic("%s: vfs_ops should be 1 but %d found\n", __func__, | ||||
mp->mnt_vfs_ops); | mp->mnt_vfs_ops); | ||||
(void) vfs_busy(mp, MBF_NOWAIT); | (void) vfs_busy(mp, MBF_NOWAIT); | ||||
atomic_add_acq_int(&vfsp->vfc_refcount, 1); | atomic_add_acq_int(&vfsp->vfc_refcount, 1); | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | vfs_mount_destroy(struct mount *mp) | ||||
} | } | ||||
KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers")); | KASSERT(TAILQ_EMPTY(&mp->mnt_uppers), ("mnt_uppers")); | ||||
if (mp->mnt_nvnodelistsize != 0) | if (mp->mnt_nvnodelistsize != 0) | ||||
panic("vfs_mount_destroy: nonzero nvnodelistsize"); | panic("vfs_mount_destroy: nonzero nvnodelistsize"); | ||||
if (mp->mnt_activevnodelistsize != 0) | if (mp->mnt_activevnodelistsize != 0) | ||||
panic("vfs_mount_destroy: nonzero activevnodelistsize"); | panic("vfs_mount_destroy: nonzero activevnodelistsize"); | ||||
if (mp->mnt_tmpfreevnodelistsize != 0) | if (mp->mnt_tmpfreevnodelistsize != 0) | ||||
panic("vfs_mount_destroy: nonzero tmpfreevnodelistsize"); | panic("vfs_mount_destroy: nonzero tmpfreevnodelistsize"); | ||||
if (mp->mnt_lazyvnodelistsize != 0) | |||||
panic("vfs_mount_destroy: nonzero lazyvnodelistsize"); | |||||
if (mp->mnt_lockref != 0) | if (mp->mnt_lockref != 0) | ||||
panic("vfs_mount_destroy: nonzero lock refcount"); | panic("vfs_mount_destroy: nonzero lock refcount"); | ||||
MNT_IUNLOCK(mp); | MNT_IUNLOCK(mp); | ||||
if (mp->mnt_vfs_ops != 1) | if (mp->mnt_vfs_ops != 1) | ||||
panic("%s: vfs_ops should be 1 but %d found\n", __func__, | panic("%s: vfs_ops should be 1 but %d found\n", __func__, | ||||
mp->mnt_vfs_ops); | mp->mnt_vfs_ops); | ||||
▲ Show 20 Lines • Show All 1,741 Lines • Show Last 20 Lines |