afs_int32 *afs_dvnextTbl; /*Dcache hash table links */
afs_int32 *afs_dcnextTbl; /*Dcache hash table links */
struct dcache **afs_indexTable; /*Pointers to dcache entries */
-afs_hyper_t *afs_indexTimes; /*Dcache entry Access times */
afs_int32 *afs_indexUnique; /*dcache entry Fid.Unique */
unsigned char *afs_indexFlags; /*(only one) Is there data there? */
afs_hyper_t afs_indexCounter; /*Fake time for marking index
/* skip if dirty or already free */
continue;
}
- tdc = afs_indexTable[i];
- if (tdc && (tdc->refCount != 0)) {
- /* Referenced; can't use it! */
- continue;
+ if (tdc) {
+ if (tdc->refCount != 0) /* Referenced; can't use it! */
+ continue;
+ hset(tdc->atime, vtime);
}
- hset(vtime, afs_indexTimes[i]);
/* if we've already looked at this one, skip it */
if (afs_indexFlags[i] & IFFlag)
AFS_STATCNT(afs_glink);
#endif
/* we know this guy's in the LRUQ. We'll move dude into DCQ below */
- DZap(&adc->f.inode);
+ DZap(adc);
/* if this guy is in the hash table, pull him out */
if (adc->f.fid.Fid.Volume != 0) {
/* remove entry from first hash chains */
{
afs_int32 chunk;
register afs_int32 i, index;
- register struct dcache *tdc;
+ register struct dcache *tdc = NULL;
AFS_STATCNT(afs_FindDCache);
chunk = AFS_CHUNK(abyte);
}
MReleaseWriteLock(&afs_xdcache);
if (index != NULLIDX) {
- hset(afs_indexTimes[tdc->index], afs_indexCounter);
+ hset(tdc->atime, afs_indexCounter);
hadd32(afs_indexCounter, 1);
return tdc;
} else
register struct osi_file *file;
register struct conn *tc;
int downDCount = 0;
- struct server *newCallback;
+ struct server *newCallback = NULL;
char setNewCallback;
char setVcacheStatus;
char doVcacheUpdate;
if (aflags & 2) {
/* don't need data, just a unique dcache entry */
ObtainWriteLock(&afs_xdcache, 608);
- hset(afs_indexTimes[tdc->index], afs_indexCounter);
+ hset(tdc->atime, afs_indexCounter);
hadd32(afs_indexCounter, 1);
ReleaseWriteLock(&afs_xdcache);
* Right now, we only have one tool, and it's a hammer. So, we
* fetch the whole file.
*/
- DZap(&tdc->f.inode); /* pages in cache may be old */
+ DZap(tdc); /* pages in cache may be old */
#ifdef IHINT
if (file = tdc->ihint) {
if (tdc->f.inode == file->inum)
afs_CFileClose(file);
ZapDCE(tdc); /* sets DFEntryMod */
if (vType(avc) == VDIR) {
- DZap(&tdc->f.inode);
+ DZap(tdc);
}
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc);
if (tdc) {
MObtainWriteLock(&afs_xdcache, 602);
- hset(afs_indexTimes[tdc->index], afs_indexCounter);
+ hset(tdc->atime, afs_indexCounter);
hadd32(afs_indexCounter, 1);
MReleaseWriteLock(&afs_xdcache);
* Initialize index times to file's mod times; init indexCounter
* to max thereof
*/
- hset32(afs_indexTimes[index], tstat.atime);
+ hset32(tdc->atime, tstat.atime);
if (hgetlo(afs_indexCounter) < tstat.atime) {
hset32(afs_indexCounter, tstat.atime);
}
afs_indexTable = (struct dcache **)
afs_osi_Alloc(sizeof(struct dcache *) * afiles);
memset((char *)afs_indexTable, 0, sizeof(struct dcache *) * afiles);
- afs_indexTimes =
- (afs_hyper_t *) afs_osi_Alloc(afiles * sizeof(afs_hyper_t));
- memset((char *)afs_indexTimes, 0, afiles * sizeof(afs_hyper_t));
afs_indexUnique =
(afs_int32 *) afs_osi_Alloc(afiles * sizeof(afs_uint32));
memset((char *)afs_indexUnique, 0, afiles * sizeof(afs_uint32));
memset((char *)tdp, 0, aDentries * sizeof(struct dcache));
#ifdef KERNEL_HAVE_PIN
pin((char *)afs_indexTable, sizeof(struct dcache *) * afiles); /* XXX */
- pin((char *)afs_indexTimes, sizeof(afs_hyper_t) * afiles); /* XXX */
pin((char *)afs_indexFlags, sizeof(char) * afiles); /* XXX */
pin((char *)afs_indexUnique, sizeof(afs_int32) * afiles); /* XXX */
pin((char *)tdp, aDentries * sizeof(struct dcache)); /* XXX */
afs_osi_Free(afs_dvnextTbl, afs_cacheFiles * sizeof(afs_int32));
afs_osi_Free(afs_dcnextTbl, afs_cacheFiles * sizeof(afs_int32));
afs_osi_Free(afs_indexTable, afs_cacheFiles * sizeof(struct dcache *));
- afs_osi_Free(afs_indexTimes, afs_cacheFiles * sizeof(afs_hyper_t));
afs_osi_Free(afs_indexUnique, afs_cacheFiles * sizeof(afs_uint32));
afs_osi_Free(afs_indexFlags, afs_cacheFiles * sizeof(u_char));
afs_osi_Free(afs_Initial_freeDSList,
unpin((char *)afs_dcnextTbl, afs_cacheFiles * sizeof(afs_int32));
unpin((char *)afs_dvnextTbl, afs_cacheFiles * sizeof(afs_int32));
unpin((char *)afs_indexTable, afs_cacheFiles * sizeof(struct dcache *));
- unpin((char *)afs_indexTimes, afs_cacheFiles * sizeof(afs_hyper_t));
unpin((char *)afs_indexUnique, afs_cacheFiles * sizeof(afs_uint32));
unpin((u_char *) afs_indexFlags, afs_cacheFiles * sizeof(u_char));
unpin(afs_Initial_freeDSList, afs_dcentries * sizeof(struct dcache));