split-cache-update-20061220

move closer to 1.4 implementation esp when split cache is turned off
This commit is contained in:
Derrick Brashear 2006-12-20 21:17:12 +00:00
parent c1c2a80c1b
commit 0420827630

View File

@ -139,6 +139,9 @@ struct afs_cacheOps *afs_cacheType;
static afs_int32 static afs_int32
afs_DCGetBucket(struct vcache *avc) afs_DCGetBucket(struct vcache *avc)
{ {
if (!splitdcache)
return 1;
/* This should be replaced with some sort of user configurable function */ /* This should be replaced with some sort of user configurable function */
if (avc->states & CRO) { if (avc->states & CRO) {
return 2; return 2;
@ -792,7 +795,7 @@ afs_GetDownD(int anumber, int *aneedSpace, afs_int32 buckethint)
} }
} else { } else {
/* found no one in phases 0-5, we're hosed */ /* found no one in phases 0-5, we're hosed */
if (j == 0) if (victimPtr == 0)
break; break;
} }
} /* big while loop */ } /* big while loop */
@ -1050,7 +1053,6 @@ afs_FreeDiscardedDCache(void)
afs_CFileTruncate(tfile, 0); afs_CFileTruncate(tfile, 0);
afs_CFileClose(tfile); afs_CFileClose(tfile);
afs_AdjustSize(tdc, 0); afs_AdjustSize(tdc, 0);
tdc->f.states &= ~(DRO|DBackup|DRW);
afs_DCMoveBucket(tdc, 0, 0); afs_DCMoveBucket(tdc, 0, 0);
/* /*
@ -1059,6 +1061,7 @@ afs_FreeDiscardedDCache(void)
MObtainWriteLock(&afs_xdcache, 511); MObtainWriteLock(&afs_xdcache, 511);
afs_indexFlags[tdc->index] &= ~IFDiscarded; afs_indexFlags[tdc->index] &= ~IFDiscarded;
afs_FreeDCache(tdc); afs_FreeDCache(tdc);
tdc->f.states &= ~(DRO|DBackup|DRW);
ReleaseWriteLock(&tdc->lock); ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc); afs_PutDCache(tdc);
MReleaseWriteLock(&afs_xdcache); MReleaseWriteLock(&afs_xdcache);
@ -1339,7 +1342,6 @@ afs_FindDCache(register struct vcache *avc, afs_size_t abyte)
break; /* leaving refCount high for caller */ break; /* leaving refCount high for caller */
} }
afs_PutDCache(tdc); afs_PutDCache(tdc);
tdc = NULL;
} }
index = afs_dcnextTbl[index]; index = afs_dcnextTbl[index];
} }