for (wvc = *uvc; wvc; uvc = &wvc->hnext, wvc = *uvc) {
if (avc == wvc) {
*uvc = avc->hnext;
- avc->hnext = (struct vcache *)NULL;
+ avc->hnext = NULL;
break;
}
}
vn_reinit(AFSTOV(avc));
#endif
afs_FreeAllAxs(&(avc->Access));
- if (!afs_shuttingdown)
- afs_QueueVCB(avc, slept);
ObtainWriteLock(&afs_xcbhash, 460);
afs_DequeueCallback(avc); /* remove it from queued callbacks list */
avc->f.states &= ~(CStatd | CUnique);
else
osi_dnlc_purgevp(avc);
+ if (!afs_shuttingdown)
+ afs_QueueVCB(avc, slept);
+
/*
* Next, keep track of which vnodes we've deleted for create's
* optimistic synchronization algorithm
i = 0;
continue; /* start over - may have raced. */
}
- if (tq == uq) {
+ if (uq == &VLRU) {
if (anumber && !defersleep) {
defersleep = 1;
- tq = VLRU.prev;
+ uq = VLRU.prev;
+ i = 0;
continue;
}
break;
if (slept) {
goto retry;
}
- tvc = nvc;
}
}
*
* \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;