diff options
-rw-r--r-- | sys/kern/vfs_mount.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 3f43dd7..205ef6f 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -83,7 +83,7 @@ static int vfs_mountroot_try(const char *mountfrom); static int vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions); static void free_mntarg(struct mntarg *ma); -static void vfs_mount_destroy(struct mount *, struct thread *); +static void vfs_mount_destroy(struct mount *); static int vfs_getopt_pos(struct vfsoptlist *opts, const char *name); static int usermount = 0; @@ -486,11 +486,10 @@ vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp, * Destroy the mount struct previously allocated by vfs_mount_alloc(). */ static void -vfs_mount_destroy(struct mount *mp, struct thread *td) +vfs_mount_destroy(struct mount *mp) { int i; - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL, td); MNT_ILOCK(mp); for (i = 0; mp->mnt_ref && i < 3; i++) msleep(mp, MNT_MTX(mp), PVFS, "mntref", hz); @@ -1009,7 +1008,8 @@ vfs_domount( VI_LOCK(vp); vp->v_iflag &= ~VI_MOUNT; VI_UNLOCK(vp); - vfs_mount_destroy(mp, td); + vfs_unbusy(mp, td); + vfs_mount_destroy(mp); vput(vp); } return (error); @@ -1211,7 +1211,8 @@ dounmount(mp, flags, td) vput(coveredvp); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); - vfs_mount_destroy(mp, td); + lockmgr(&mp->mnt_lock, LK_RELEASE, NULL, td); + vfs_mount_destroy(mp); return (0); } |