}
- if (tvc) {
+ if (tvc)
osi_dnlc_purgedp(tvc); /* get rid of any entries for this directory */
- afs_symhint_inval(tvc);
- } else
+ else
osi_dnlc_remove(adp, aname, 0);
if (tvc) {
SHARED_LOCK, NULL));
osi_dnlc_remove(adp, aname, tvc);
- if (tvc)
- afs_symhint_inval(tvc); /* XXX: don't really need to be so extreme */
if (code) {
if (tdc) {
}
osi_dnlc_remove(adp, aname, tvc);
- if (tvc)
- afs_symhint_inval(tvc);
Tadp1 = adp;
Tadpr = VREFCOUNT(adp);
osi_dnlc_remove(aodp, aname1, 0);
osi_dnlc_remove(andp, aname2, 0);
- afs_symhint_inval(aodp);
- afs_symhint_inval(andp);
/*
* Make sure that the data in the cache is current. We may have
extern afs_int32 vmPageHog; /* counter for # of vnodes which are page hogs. */
-/*
- * Fast map from vcache to dcache
- */
-struct vtodc {
- struct dcache *dc;
- afs_uint32 stamp;
- struct osi_file *f;
- afs_offs_t minLoc; /* smallest offset into dc. */
- afs_offs_t len; /* largest offset into dc. */
-};
-
-extern afs_uint32 afs_stampValue; /* stamp for pair's usage */
-#define MakeStamp() (++afs_stampValue)
-
#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
#define VTOAFS(v) ((struct vcache *)(v)->v_data)
#define AFSTOV(vc) ((vc)->v)
#if defined(AFS_SUN5_ENV)
afs_uint32 vstates; /* vstate bits */
#endif /* defined(AFS_SUN5_ENV) */
- struct vtodc quick;
- afs_uint32 symhintstamp;
- union {
- struct vcache *symhint;
- struct dcache *dchint;
- } h1;
+ struct dcache *dchint;
#ifdef AFS_LINUX22_ENV
u_short mapcnt; /* Number of mappings of this file. */
#endif
#endif
};
-#define afs_symhint_inval(avc)
-
-
#define DONT_CHECK_MODE_BITS 0
#define CHECK_MODE_BITS 1
#define CMB_ALLOW_EXEC_AS_READ 2 /* For the NFS xlator */
char dflags; /* Data flags */
char mflags; /* Meta flags */
struct fcache f; /* disk image */
- afs_int32 stamp; /* used with vtodc struct for hints */
afs_int32 bucket; /* which bucket these dcache entries are in */
/*
* Locking rules:
* Note that dcache.lock(W) gives you the right to update mflags,
* as dcache.mflock(W) can only be held with dcache.lock(R).
*
- * dcache.stamp is protected by the associated vcache lock, because
- * it's only purpose is to establish correspondence between vcache
- * and dcache entries.
- *
* dcache.index, dcache.f.fid, dcache.f.chunk and dcache.f.inode are
* write-protected by afs_xdcache and read-protected by refCount.
* Once an entry is referenced, these values cannot change, and if
* ensuring noone else has a refCount on it).
*/
};
-/* this is obsolete and should be removed */
-#define ihint stamp
/* afs_memcache.c */
struct memCacheEntry {
for (tvc = afs_vhashTV[i]; tvc; tvc = tvc->vhnext) {
if (tvc->fid.Fid.Volume == a_fid->Volume) {
tvc->callback = NULL;
- tvc->quick.stamp = 0;
if (!localFid.Cell)
localFid.Cell = tvc->fid.Cell;
- tvc->h1.dchint = NULL; /* invalidate hints */
+ tvc->dchint = NULL; /* invalidate hints */
ObtainWriteLock(&afs_xcbhash, 449);
afs_DequeueCallback(tvc);
tvc->states &= ~(CStatd | CUnique | CBulkFetching);
&& tvc->fid.Fid.Volume == a_fid->Volume
&& tvc->fid.Fid.Unique == a_fid->Unique) {
tvc->callback = NULL;
- tvc->quick.stamp = 0;
- tvc->h1.dchint = NULL; /* invalidate hints */
+ tvc->dchint = NULL; /* invalidate hints */
ObtainWriteLock(&afs_xcbhash, 450);
afs_DequeueCallback(tvc);
tvc->states &= ~(CStatd | CUnique | CBulkFetching);
QRemove(&(avc->callsort));
avc->callsort.prev = avc->callsort.next = NULL;
} else; /* must have got dequeued in a race */
- afs_symhint_inval(avc);
return;
} /* afs_DequeueCallback */
if ((tvc->fid.Fid.Vnode & 1)
|| (vType(tvc) == VDIR))
osi_dnlc_purgedp(tvc);
- tvc->quick.stamp = 0;
- tvc->h1.dchint = NULL; /*invalidate em */
+ tvc->dchint = NULL; /*invalidate em */
afs_ResetVolumeInfo(tvp);
break;
}
for (i = 0; i < VCSIZE; i++) /* reset all the vnodes */
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
tvc->callback = 0;
- tvc->quick.stamp = 0;
- tvc->h1.dchint = NULL; /* invalidate hints */
+ tvc->dchint = NULL; /* invalidate hints */
tvc->states &= ~(CStatd);
if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR))
osi_dnlc_purgedp(tvc);
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
if (tvc->callback == srvp) {
tvc->callback = 0;
- tvc->quick.stamp = 0;
- tvc->h1.dchint = NULL; /* invalidate hints */
+ tvc->dchint = NULL; /* invalidate hints */
tvc->states &= ~(CStatd);
if ((tvc->fid.Fid.Vnode & 1) || (vType(tvc) == VDIR)) {
osi_dnlc_purgedp(tvc);
#endif
}
- tdc->stamp = 0;
-#ifdef IHINT
- if (tdc->ihint) {
- struct osi_file *f = (struct osi_file *)tdc->ihint;
- tdc->ihint = 0;
- afs_UFSClose(f);
- nihints--;
- }
-#endif /* IHINT */
-
-
/* finally put the entry in the free list */
afs_indexTable[ix] = NULL;
afs_indexFlags[ix] &= ~IFEverUsed;
updateV2DC(int lockVc, struct vcache *v, struct dcache *d, int src)
{
if (!lockVc || 0 == NBObtainWriteLock(&v->lock, src)) {
- if (hsame(v->m.DataVersion, d->f.versionNo) && v->callback) {
- v->quick.dc = d;
- v->quick.stamp = d->stamp = MakeStamp();
- v->quick.minLoc = AFS_CHUNKTOBASE(d->f.chunk);
- /* Don't think I need these next two lines forever */
- v->quick.len = d->f.chunkBytes;
- v->h1.dchint = d;
- }
+ if (hsame(v->m.DataVersion, d->f.versionNo) && v->callback)
+ v->dchint = d;
if (lockVc)
ReleaseWriteLock(&v->lock);
}
shortcut = 0;
/* check hints first! (might could use bcmp or some such...) */
- if ((tdc = avc->h1.dchint)) {
+ if ((tdc = avc->dchint)) {
int dcLocked;
/*
* fetch the whole file.
*/
DZap(tdc); /* pages in cache may be old */
-#ifdef IHINT
- if (file = tdc->ihint) {
- if (tdc->f.inode == file->inum)
- usedihint++;
- else {
- tdc->ihint = 0;
- afs_UFSClose(file);
- file = 0;
- nihints--;
- file = osi_UFSOpen(tdc->f.inode);
- }
- } else
-#endif /* IHINT */
- file = afs_CFileOpen(tdc->f.inode);
+ file = afs_CFileOpen(tdc->f.inode);
afs_RemoveVCB(&avc->fid);
tdc->f.states |= DWriting;
tdc->dflags |= DFFetching;
} else {
tdc = tmpdc;
tdc->f.states = 0;
- tdc->ihint = 0;
}
/*
/* now find the disk cache entries */
afs_TryToSmush(avc, *acred, 1);
osi_dnlc_purgedp(avc);
- afs_symhint_inval(avc);
if (avc->linkData && !(avc->states & CCore)) {
afs_osi_Free(avc->linkData, strlen(avc->linkData) + 1);
avc->linkData = NULL;
/* now find the disk cache entries */
afs_TryToSmush(tvc, *acred, 1);
osi_dnlc_purgedp(tvc);
- afs_symhint_inval(tvc);
if (tvc->linkData && !(tvc->states & CCore)) {
afs_osi_Free(tvc->linkData, strlen(tvc->linkData) + 1);
tvc->linkData = NULL;
afs_DequeueCallback(avc); /* remove it from queued callbacks list */
avc->states &= ~(CStatd | CUnique);
ReleaseWriteLock(&afs_xcbhash);
- afs_symhint_inval(avc);
if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp(avc); /* if it (could be) a directory */
else
tvc->fid = *afid;
tvc->asynchrony = -1;
tvc->vc_error = 0;
- afs_symhint_inval(tvc);
#ifdef AFS_TEXT_ENV
tvc->flushDV.low = tvc->flushDV.high = AFS_MAXDV;
#endif
vn_initlist((struct vnlist *)&tvc->v);
tvc->lastr = 0;
#endif /* AFS_SGI_ENV */
- tvc->h1.dchint = 0;
+ tvc->dchint = NULL;
osi_dnlc_purgedp(tvc); /* this may be overkill */
- memset((char *)&(tvc->quick), 0, sizeof(struct vtodc));
memset((char *)&(tvc->callsort), 0, sizeof(struct afs_q));
tvc->slocks = NULL;
i = VCHash(afid);
XSTATS_DECLS;
do {
tc = afs_Conn(afid, areq, SHARED_LOCK);
- avc->quick.stamp = 0;
- avc->h1.dchint = NULL; /* invalidate hints */
+ avc->dchint = NULL; /* invalidate hints */
if (tc) {
avc->callback = tc->srvr->server;
start = osi_Time();