darwin-remunlink-20070320

FIXES 55280

make reumlink work the way it's supposed to
This commit is contained in:
Chas Williams 2007-03-20 19:29:41 +00:00 committed by Derrick Brashear
parent ff81d7e77a
commit c2fb9440f3

View File

@ -1194,8 +1194,12 @@ afs_vop_remove(ap)
cache_purge(vp);
if (!error) {
#ifdef AFS_DARWIN80_ENV
struct vcache *tvc = VTOAFS(vp);
if (!(tvc->states & CUnlinked)) {
ubc_setsize(vp, (off_t)0);
vnode_recycle(vp);
}
#else
/* necessary so we don't deadlock ourselves in vclean */
VOP_UNLOCK(vp, 0, cnp->cn_proc);
@ -1626,9 +1630,18 @@ afs_vop_inactive(ap)
vprint("afs_vop_inactive(): pushing active", vp);
#endif
if (tvc) {
#ifdef AFS_DARWIN80_ENV
int unlinked = tvc->states & CUnlinked;
#endif
AFS_GLOCK();
afs_InactiveVCache(tvc, 0); /* decrs ref counts */
AFS_GUNLOCK();
#ifdef AFS_DARWIN80_ENV
if (unlinked) {
vnode_recycle(vp);
cache_purge(vp);
}
#endif
}
#ifndef AFS_DARWIN80_ENV
VOP_UNLOCK(vp, 0, ap->a_p);