static afs_int32
afs_DCGetBucket(struct vcache *avc)
{
- /* This should be replaced with some sort of user configurable function */
- if (avc->states & CRO) {
- return 2;
- } else if (avc->states & CBackup) {
- return 1;
- } else {
- /* RW */
- }
- /* main bucket */
- return 1;
+ if (!splitdcache)
+ return 1;
+
+ /* This should be replaced with some sort of user configurable function */
+ if (avc->states & CRO) {
+ return 2;
+ } else if (avc->states & CBackup) {
+ return 1;
+ } else {
+ /* RW */
+ }
+ /* main bucket */
+ return 1;
}
static void
}
} else {
/* found no one in phases 0-5, we're hosed */
- if (j == 0)
+ if (victimPtr == 0)
break;
}
} /* big while loop */
afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile);
afs_AdjustSize(tdc, 0);
- tdc->f.states &= ~(DRO|DBackup|DRW);
afs_DCMoveBucket(tdc, 0, 0);
/*
MObtainWriteLock(&afs_xdcache, 511);
afs_indexFlags[tdc->index] &= ~IFDiscarded;
afs_FreeDCache(tdc);
+ tdc->f.states &= ~(DRO|DBackup|DRW);
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc);
MReleaseWriteLock(&afs_xdcache);
break; /* leaving refCount high for caller */
}
afs_PutDCache(tdc);
- tdc = NULL;
}
index = afs_dcnextTbl[index];
}