X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d52fe63fc81f7e44faaae711812a211a78434976..9bccf70c0258c7cac2dcb80011b2a964d884c552:/bsd/miscfs/nullfs/null_vfsops.c?ds=sidebyside diff --git a/bsd/miscfs/nullfs/null_vfsops.c b/bsd/miscfs/nullfs/null_vfsops.c index ffcaa3d81..66f61af3d 100644 --- a/bsd/miscfs/nullfs/null_vfsops.c +++ b/bsd/miscfs/nullfs/null_vfsops.c @@ -205,27 +205,20 @@ nullfs_unmount(mp, mntflags, p) struct vnode *nullm_rootvp = MOUNTTONULLMOUNT(mp)->nullm_rootvp; int error; int flags = 0; + int force = 0; #ifdef NULLFS_DIAGNOSTIC printf("nullfs_unmount(mp = %x)\n", mp); #endif - if (mntflags & MNT_FORCE) + if (mntflags & MNT_FORCE) { flags |= FORCECLOSE; + force = 1; + } - /* - * Clear out buffer cache. I don't think we - * ever get anything cached at this level at the - * moment, but who knows... - */ -#if 0 - mntflushbuf(mp, 0); - if (mntinvalbuf(mp, 1)) - return (EBUSY); -#endif - if (nullm_rootvp->v_usecount > 1) + if ( (nullm_rootvp->v_usecount > 1) && !force ) return (EBUSY); - if (error = vflush(mp, nullm_rootvp, flags)) + if ( (error = vflush(mp, nullm_rootvp, flags)) && !force ) return (error); #ifdef NULLFS_DIAGNOSTIC