diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 254cecee6924..78eb91673294 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.91 2017/02/17 08:31:24 hannken Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.91 2017/02/17 08:31:24 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.92 2017/04/17 08:31:01 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -192,7 +192,7 @@ cd9660_mountroot(void) args.flags = ISOFSMNT_ROOT; if ((error = iso_mountfs(rootvp, mp, l, &args)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } mountlist_append(mp); diff --git a/sys/fs/filecorefs/filecore_vfsops.c b/sys/fs/filecorefs/filecore_vfsops.c index 13d3fbb748d4..2c64eab8bb5e 100644 --- a/sys/fs/filecorefs/filecore_vfsops.c +++ b/sys/fs/filecorefs/filecore_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_vfsops.c,v 1.79 2017/02/17 08:31:24 hannken Exp $ */ +/* $NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $ */ /*- * Copyright (c) 1994 The Regents of the University of California. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.79 2017/02/17 08:31:24 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.80 2017/04/17 08:31:01 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -202,7 +202,7 @@ filecore_mountroot(void) args.flags = FILECOREMNT_ROOT; if ((error = filecore_mountfs(rootvp, mp, p, &args)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } mountlist_append(mp); diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 7d8605edc749..76791ae32520 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.126 2017/04/17 08:31:01 hannken Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.125 2017/04/01 19:35:56 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.126 2017/04/17 08:31:01 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -248,14 +248,14 @@ msdosfs_mountroot(void) if ((error = msdosfs_mountfs(rootvp, mp, l, &args)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } if ((error = update_mp(mp, &args)) != 0) { (void)msdosfs_unmount(mp, 0); vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); vrele(rootvp); return (error); } diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index b27893a1c75c..90317be8da3b 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $ */ +/* $NetBSD: ntfs_vfsops.c,v 1.106 2017/04/17 08:31:01 hannken Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.105 2017/02/17 08:31:24 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.106 2017/04/17 08:31:01 hannken Exp $"); #include #include @@ -116,7 +116,7 @@ ntfs_mountroot(void) if ((error = ntfs_mountfs(rootvp, mp, &args, l)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } diff --git a/sys/fs/puffs/puffs_msgif.c b/sys/fs/puffs/puffs_msgif.c index fd06a9156818..3023a532e018 100644 --- a/sys/fs/puffs/puffs_msgif.c +++ b/sys/fs/puffs/puffs_msgif.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_msgif.c,v 1.100 2016/12/26 08:21:09 skrll Exp $ */ +/* $NetBSD: puffs_msgif.c,v 1.101 2017/04/17 08:31:01 hannken Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.100 2016/12/26 08:21:09 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.101 2017/04/17 08:31:01 hannken Exp $"); #include #include @@ -1097,7 +1097,7 @@ puffs_sop_thread(void *arg) * We know the mountpoint is still alive because * the thread that is us (poetic?) is still alive. */ - atomic_inc_uint((unsigned int*)&mp->mnt_refcnt); + vfs_ref(mp); break; } @@ -1137,7 +1137,7 @@ puffs_sop_thread(void *arg) */ if (unmountme) { (void)dounmount(mp, MNT_FORCE, curlwp); - vfs_destroy(mp); + vfs_rele(mp); } kthread_exit(0); @@ -1182,13 +1182,13 @@ puffs_msgif_close(void *ctx) } /* Won't access pmp from here anymore */ - atomic_inc_uint((unsigned int*)&mp->mnt_refcnt); + vfs_ref(mp); puffs_mp_release(pmp); mutex_exit(&pmp->pmp_lock); /* Detach from VFS. */ (void)dounmount(mp, MNT_FORCE, curlwp); - vfs_destroy(mp); + vfs_rele(mp); return 0; } diff --git a/sys/fs/v7fs/v7fs_vfsops.c b/sys/fs/v7fs/v7fs_vfsops.c index 0c95ee76349a..712025a42665 100644 --- a/sys/fs/v7fs/v7fs_vfsops.c +++ b/sys/fs/v7fs/v7fs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: v7fs_vfsops.c,v 1.13 2017/04/01 19:35:57 riastradh Exp $ */ +/* $NetBSD: v7fs_vfsops.c,v 1.14 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.13 2017/04/01 19:35:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: v7fs_vfsops.c,v 1.14 2017/04/17 08:31:02 hannken Exp $"); #if defined _KERNEL_OPT #include "opt_v7fs.h" #endif @@ -580,7 +580,7 @@ v7fs_mountroot(void) if ((error = v7fs_mountfs(rootvp, mp, _BYTE_ORDER))) { DPRINTF("mountfs error=%d\n", error); vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return error; } diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index f96a3c99e538..1bf9c7a442a9 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_mount.c,v 1.54 2017/04/17 08:29:58 hannken Exp $ */ +/* $NetBSD: vfs_mount.c,v 1.55 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.54 2017/04/17 08:29:58 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.55 2017/04/17 08:31:02 hannken Exp $"); #include #include @@ -263,11 +263,23 @@ vfs_getvfs(fsid_t *fsid) return NULL; } +/* + * Take a reference to a mount structure. + */ +void +vfs_ref(struct mount *mp) +{ + + KASSERT(mp->mnt_refcnt > 0 || mutex_owned(&mountlist_lock)); + + atomic_inc_uint(&mp->mnt_refcnt); +} + /* * Drop a reference to a mount structure, freeing if the last reference. */ void -vfs_destroy(struct mount *mp) +vfs_rele(struct mount *mp) { if (__predict_true((int)atomic_dec_uint_nv(&mp->mnt_refcnt) > 0)) { @@ -315,7 +327,7 @@ vfs_busy(struct mount *mp, struct mount **nextp) ++mp->mnt_busynest; KASSERT(mp->mnt_busynest != 0); mutex_exit(&mp->mnt_unmounting); - atomic_inc_uint(&mp->mnt_refcnt); + vfs_ref(mp); return 0; } @@ -340,7 +352,7 @@ vfs_unbusy(struct mount *mp, bool keepref, struct mount **nextp) mp->mnt_busynest--; mutex_exit(&mp->mnt_unmounting); if (!keepref) { - vfs_destroy(mp); + vfs_rele(mp); } } @@ -460,7 +472,7 @@ vfs_insmntque(vnode_t *vp, struct mount *mp) if (omp != NULL) { /* Release reference to old mount. */ - vfs_destroy(omp); + vfs_rele(omp); } } @@ -716,7 +728,7 @@ mount_domount(struct lwp *l, vnode_t **vpp, struct vfsops *vfsops, if ((error = fstrans_mount(mp)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return error; } @@ -791,7 +803,7 @@ mount_domount(struct lwp *l, vnode_t **vpp, struct vfsops *vfsops, (void)start_extattr(mp); } /* Drop reference held for VFS_START(). */ - vfs_destroy(mp); + vfs_rele(mp); *vpp = NULL; return error; @@ -804,7 +816,7 @@ err_unmounted: mutex_exit(&mp->mnt_updating); fstrans_unmount(mp); vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return error; } @@ -941,7 +953,7 @@ dounmount(struct mount *mp, int flags, struct lwp *l) vfs_hooks_unmount(mp); fstrans_unmount(mp); - vfs_destroy(mp); /* reference from mount() */ + vfs_rele(mp); /* reference from mount() */ if (coveredvp != NULLVP) { vrele(coveredvp); } @@ -986,9 +998,9 @@ vfs_unmount_next(uint64_t gen) if ((nmp == NULL || mp->mnt_gen > nmp->mnt_gen) && mp->mnt_gen < gen) { if (nmp != NULL) - vfs_destroy(nmp); + vfs_rele(nmp); nmp = mp; - atomic_inc_uint(&nmp->mnt_refcnt); + vfs_ref(nmp); } } mountlist_iterator_destroy(iter); @@ -1015,7 +1027,7 @@ vfs_unmount_forceone(struct lwp *l) vfs_unmount_print(mp, "forcefully "); return true; } else { - vfs_destroy(mp); + vfs_rele(mp); } #ifdef DEBUG @@ -1050,7 +1062,7 @@ vfs_unmountall1(struct lwp *l, bool force, bool verbose) vfs_unmount_print(mp, ""); progress = true; } else { - vfs_destroy(mp); + vfs_rele(mp); if (verbose) { printf("unmount of %s failed with error %d\n", mp->mnt_stat.f_mntonname, error); @@ -1551,16 +1563,16 @@ mountlist_iterator_next(mount_iterator_t *mi) /* Take an initial reference for vfs_busy() below. */ mp = me->me_mount; KASSERT(mp != NULL); - atomic_inc_uint(&mp->mnt_refcnt); + vfs_ref(mp); mutex_exit(&mountlist_lock); /* Try to mark this mount busy and return on success. */ if (vfs_busy(mp, NULL) == 0) { - vfs_destroy(mp); + vfs_rele(mp); marker->me_mount = mp; return mp; } - vfs_destroy(mp); + vfs_rele(mp); mutex_enter(&mountlist_lock); } } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 87cce5156bd7..95f7327bfdf8 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.510 2017/04/12 10:28:39 hannken Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.511 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.510 2017/04/12 10:28:39 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.511 2017/04/17 08:31:02 hannken Exp $"); #ifdef _KERNEL_OPT #include "opt_fileassoc.h" @@ -595,14 +595,14 @@ sys_unmount(struct lwp *l, const struct sys_unmount_args *uap, register_t *retva pathbuf_destroy(pb); mp = vp->v_mount; - atomic_inc_uint(&mp->mnt_refcnt); + vfs_ref(mp); VOP_UNLOCK(vp); error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_MOUNT, KAUTH_REQ_SYSTEM_MOUNT_UNMOUNT, mp, NULL, NULL); if (error) { vrele(vp); - vfs_destroy(mp); + vfs_rele(mp); return (error); } @@ -611,7 +611,7 @@ sys_unmount(struct lwp *l, const struct sys_unmount_args *uap, register_t *retva */ if (mp->mnt_flag & MNT_ROOTFS) { vrele(vp); - vfs_destroy(mp); + vfs_rele(mp); return (EINVAL); } @@ -620,13 +620,13 @@ sys_unmount(struct lwp *l, const struct sys_unmount_args *uap, register_t *retva */ if ((vp->v_vflag & VV_ROOT) == 0) { vrele(vp); - vfs_destroy(mp); + vfs_rele(mp); return (EINVAL); } vrele(vp); error = dounmount(mp, SCARG(uap, flags), l); - vfs_destroy(mp); + vfs_rele(mp); return error; } diff --git a/sys/kern/vfs_trans.c b/sys/kern/vfs_trans.c index b4a0e3576d6e..6ff48d4249c8 100644 --- a/sys/kern/vfs_trans.c +++ b/sys/kern/vfs_trans.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_trans.c,v 1.41 2017/04/12 10:23:35 hannken Exp $ */ +/* $NetBSD: vfs_trans.c,v 1.42 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.41 2017/04/12 10:23:35 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.42 2017/04/17 08:31:02 hannken Exp $"); /* * File system transaction operations. @@ -179,7 +179,7 @@ fstrans_mount_dtor(struct mount *mp) mutex_exit(&fstrans_mount_lock); kmem_free(fmi, sizeof(*fmi)); - vfs_destroy(mp); + vfs_rele(mp); } /* diff --git a/sys/kern/vfs_vnode.c b/sys/kern/vfs_vnode.c index 19ea4c8e8aa3..b10f630d8c67 100644 --- a/sys/kern/vfs_vnode.c +++ b/sys/kern/vfs_vnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $ */ +/* $NetBSD: vfs_vnode.c,v 1.86 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 1997-2011 The NetBSD Foundation, Inc. @@ -156,7 +156,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.85 2017/04/16 16:48:08 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.86 2017/04/17 08:31:02 hannken Exp $"); #include #include @@ -1595,7 +1595,7 @@ vcache_reclaim(vnode_t *vp) * operations vector. See sys/kern/vnode_if.c. */ vp->v_vflag &= ~VV_ROOT; - atomic_inc_uint(&dead_rootmount->mnt_refcnt); + vfs_ref(dead_rootmount); vfs_insmntque(vp, dead_rootmount); mutex_enter(vp->v_interlock); diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index e130da41e0e4..466a2c2b1c6e 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vfsops.c,v 1.233 2017/04/01 19:35:57 riastradh Exp $ */ +/* $NetBSD: nfs_vfsops.c,v 1.234 2017/04/17 08:31:02 hannken Exp $ */ /* * Copyright (c) 1989, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.233 2017/04/01 19:35:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.234 2017/04/17 08:31:02 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfs.h" @@ -436,7 +436,7 @@ nfs_mount_diskless(struct nfs_dlmount *ndmntp, const char *mntname, struct mount ndmntp->ndm_args.hostname, vpp, l); if (error) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); printf("nfs_mountroot: mount %s failed: %d\n", mntname, error); } else diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 21e33860838a..7c5a4ff4ae70 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1,4 +1,4 @@ -/* $NetBSD: mount.h,v 1.223 2017/04/17 08:29:58 hannken Exp $ */ +/* $NetBSD: mount.h,v 1.224 2017/04/17 08:31:02 hannken Exp $ */ /* * Copyright (c) 1989, 1991, 1993 @@ -424,7 +424,8 @@ int vfs_detach(struct vfsops *); void vfs_reinit(void); struct vfsops *vfs_getopsbyname(const char *); void vfs_delref(struct vfsops *); -void vfs_destroy(struct mount *); +void vfs_ref(struct mount *); +void vfs_rele(struct mount *); struct mount *vfs_mountalloc(struct vfsops *, struct vnode *); int vfs_stdextattrctl(struct mount *, int, struct vnode *, int, const char *); diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index e5bc70f8ced7..8495fa11e963 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_vfsops.c,v 1.206 2017/04/01 19:35:57 riastradh Exp $ */ +/* $NetBSD: ext2fs_vfsops.c,v 1.207 2017/04/17 08:31:02 hannken Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1994 @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.206 2017/04/01 19:35:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.207 2017/04/17 08:31:02 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -280,7 +280,7 @@ ext2fs_mountroot(void) if ((error = ext2fs_mountfs(rootvp, mp)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return error; } mountlist_append(mp); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 7ac3676d45e5..13310932f26f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.351 2017/04/01 19:35:56 riastradh Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.352 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.351 2017/04/01 19:35:56 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.352 2017/04/17 08:31:02 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_ffs.h" @@ -378,7 +378,7 @@ ffs_mountroot(void) mp->mnt_flag |= MNT_FORCE; if ((error = ffs_mountfs(rootvp, mp, l)) != 0) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } mp->mnt_flag &= ~MNT_FORCE; diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index 65f0a9523555..2bd0adf1b4ed 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.357 2017/04/13 09:57:28 hannken Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.358 2017/04/17 08:31:02 hannken Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007 @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.357 2017/04/13 09:57:28 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.358 2017/04/17 08:31:02 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_lfs.h" @@ -596,7 +596,7 @@ lfs_mountroot(void) } if ((error = lfs_mountfs(rootvp, mp, l))) { vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_rele(mp); return (error); } mountlist_append(mp); diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index 5530e9df4890..55e98d9fa57a 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: mfs_vfsops.c,v 1.111 2017/02/17 08:31:26 hannken Exp $ */ +/* $NetBSD: mfs_vfsops.c,v 1.112 2017/04/17 08:31:02 hannken Exp $ */ /* * Copyright (c) 1989, 1990, 1993, 1994 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.111 2017/02/17 08:31:26 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.112 2017/04/17 08:31:02 hannken Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -217,7 +217,7 @@ mfs_mountroot(void) if ((error = ffs_mountfs(rootvp, mp, l)) != 0) { vfs_unbusy(mp, false, NULL); bufq_free(mfsp->mfs_buflist); - vfs_destroy(mp); + vfs_rele(mp); kmem_free(mfsp, sizeof(*mfsp)); return (error); }