X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2FDARWIN%2Fosi_vm.c;h=0c2b1a1961ab4c0d7ac7924c6efb4b5d106c8b57;hp=df1f8e5430ab857934d2439626912dce7e8e0cac;hb=e81615d0f1ca357eb5e44a0c3b54046798702a8f;hpb=bc9bbe8a955aabfcf42265e3d81a60b5f4c1aa40 diff --git a/src/afs/DARWIN/osi_vm.c b/src/afs/DARWIN/osi_vm.c index df1f8e5..0c2b1a1 100644 --- a/src/afs/DARWIN/osi_vm.c +++ b/src/afs/DARWIN/osi_vm.c @@ -61,6 +61,30 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept) ubc_release(vp); ubc_info_free(vp); } +#else + /* This is literally clean_up_name_parent_ptrs() */ + /* Critical to clean up any state attached to the vnode here since it's + being recycled, and we're not letting refcnt drop to 0 to trigger + normal recycling. */ + if (VNAME(vp) || VPARENT(vp)) { + char *tmp1; + struct vnode *tmp2; + + /* do it this way so we don't block before clearing + these fields. */ + tmp1 = VNAME(vp); + tmp2 = VPARENT(vp); + VNAME(vp) = NULL; + VPARENT(vp) = NULL; + + if (tmp1) { + remove_name(tmp1); + } + + if (tmp2) { + vrele(tmp2); + } + } #endif AFS_GLOCK(); @@ -178,6 +202,12 @@ osi_VM_TryReclaim(struct vcache *avc, int *slept) AFS_RELE(vp); return; } + if (ISSET(vp->v_flag, VUINACTIVE)) { + simple_unlock(&vp->v_interlock); + AFS_RELE(vp); + printf("vnode %x still inactive!", vp); + return; + } #ifdef AFS_DARWIN14_ENV if (vp->v_ubcinfo->ui_refcount > 1 || vp->v_ubcinfo->ui_mapped) { simple_unlock(&vp->v_interlock);