} else if (afs_ConflictPolicy == SERVER_WINS) {
/* DV mismatch, apply collision resolution policy. */
/* Discard this files chunks and remove from current dir. */
- afs_ResetVCache(tvc, acred);
+ afs_ResetVCache(tvc, acred, 0);
tvc->f.truncPos = AFS_NOTRUNC;
} else {
/* printf("afs_ResyncDisconFiles: no resolution policy selected.\n"); */
ObtainWriteLock(&tvc->lock, 706);
if (squash)
- afs_ResetVCache(tvc, acred);
+ afs_ResetVCache(tvc, acred, 0);
afs_DeleteShadowDir(tvc);
ReleaseWriteLock(&afs_disconDirtyLock);
ObtainWriteLock(&tvc->lock, 718);
- afs_ResetVCache(tvc, acred);
+ afs_ResetVCache(tvc, acred, 0);
tvc->f.truncPos = AFS_NOTRUNC;
ReleaseWriteLock(&tvc->lock);
ObtainWriteLock(&afs_disconDirtyLock, 719);
afs_BozonLock(&avc->pvnLock, avc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&avc->lock, 225);
- afs_ResetVCache(avc, *acred);
+ afs_ResetVCache(avc, *acred, 0);
ReleaseWriteLock(&avc->lock);
#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&avc->pvnLock, avc);
afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&tvc->lock, 232);
-
- ObtainWriteLock(&afs_xcbhash, 458);
- afs_DequeueCallback(tvc);
- tvc->f.states &= ~(CStatd | CDirty);
- ReleaseWriteLock(&afs_xcbhash);
- if (tvc->f.fid.Fid.Vnode & 1 || (vType(tvc) == VDIR))
- osi_dnlc_purgedp(tvc);
- afs_TryToSmush(tvc, *acred, 1);
+ afs_ResetVCache(tvc, *acred, 1);
ReleaseWriteLock(&tvc->lock);
#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
struct AFSCallBack *CallBackp,
struct server **serverp,
struct AFSVolSync *tsyncp);
-extern void afs_ResetVCache(struct vcache *, afs_ucred_t *);
+extern void afs_ResetVCache(struct vcache *, afs_ucred_t *, afs_int32 skipdnlc);
extern afs_int32 afs_NFSFindVCache(struct vcache **avcp,
struct VenusFid *afid);
extern void afs_vcacheInit(int astatSize);
*
* \param avc Pointer to the cache entry to reset
* \param acred
+ * \param skipdnlc skip the dnlc purge for this vnode
*
* \note avc must be write locked on entry
+ *
+ * \note The caller should purge the dnlc when skipdnlc is set.
*/
void
-afs_ResetVCache(struct vcache *avc, afs_ucred_t *acred)
+afs_ResetVCache(struct vcache *avc, afs_ucred_t *acred, afs_int32 skipdnlc)
{
ObtainWriteLock(&afs_xcbhash, 456);
afs_DequeueCallback(avc);
ReleaseWriteLock(&afs_xcbhash);
/* now find the disk cache entries */
afs_TryToSmush(avc, acred, 1);
- osi_dnlc_purgedp(avc);
+ if (!skipdnlc) {
+ osi_dnlc_purgedp(avc);
+ }
if (avc->linkData && !(avc->f.states & CCore)) {
afs_osi_Free(avc->linkData, strlen(avc->linkData) + 1);
avc->linkData = NULL;