* afs_WriteVCacheDiscon
* afs_SimpleVStat
* afs_ProcessFS
- * TellALittleWhiteLie
* afs_RemoteLookup
* afs_GetVCache
* afs_LookupVCache
/* Hash only on volume to speed up volume callbacks. */
int VCHashV(struct VenusFid *fid)
{
- return opr_jhash_int(fid->Fid.Vnode, 0) & opr_jhash_mask(VCSIZEBITS);
+ return opr_jhash_int(fid->Fid.Volume, 0) & opr_jhash_mask(VCSIZEBITS);
}
/*!
AFSTOV(avc) = NULL; /* also drop the ptr to vnode */
}
#endif
-#ifdef AFS_SUN510_ENV
+
+#ifdef AFS_SUN511_ENV
+ if (avc->v) {
+ vn_free(avc->v);
+ avc->v = NULL;
+ }
+#elif defined(AFS_SUN510_ENV)
/* As we use private vnodes, cleanup is up to us */
vn_reinit(AFSTOV(avc));
#endif
/* we can't keep trying to push back dirty data forever. Give up. */
afs_InvalidateAllSegments(avc); /* turns off dirty bit */
}
- avc->f.states &= ~CMAPPED; /* mainly used by SunOS 4.0.x */
+ avc->f.states &= ~CMAPPED;
avc->f.states &= ~CDirty; /* Turn it off */
if (avc->f.states & CUnlinked) {
if (CheckLock(&afs_xvcache) || CheckLock(&afs_xdcache)) {
ReleaseWriteLock(&avc->lock);
/* fetch the status info */
- tvc = afs_GetVCache(&avc->f.fid, areq, NULL, avc);
+ tvc = afs_GetVCache(&avc->f.fid, areq);
if (!tvc)
return EIO;
/* Put it back; caller has already incremented vrefCount */
* \param afid File ID.
* \param areq Ptr to associated vrequest structure, specifying the
* user whose authentication tokens will be used.
- * \param avc Caller may already have a vcache for this file, which is
- * already held.
*
* \note Environment:
* The cache entry is returned with an increased vrefCount field.
* locking directories in a constant order.
*
* \note NB. NewVCache -> FlushVCache presently (4/10/95) drops the xvcache lock.
- *
- * \note Might have a vcache structure already, which must
- * already be held by the caller
*/
struct vcache *
-afs_GetVCache(struct VenusFid *afid, struct vrequest *areq,
- afs_int32 * cached, struct vcache *avc)
+afs_GetVCache(struct VenusFid *afid, struct vrequest *areq)
{
afs_int32 code, newvcache = 0;
AFS_STATCNT(afs_GetVCache);
- if (cached)
- *cached = 0; /* Init just in case */
-
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
loop:
#endif
#endif
}
if (tvc) {
- if (cached)
- *cached = 1;
osi_Assert((tvc->f.states & CVInit) == 0);
/* If we are in readdir, return the vnode even if not statd */
if ((tvc->f.states & CStatd) || afs_InReadDir(tvc)) {
*
* \param afid
* \param areq
- * \param cached Is element cached? If NULL, don't answer.
* \param adp
* \param aname
*
*/
struct vcache *
afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq,
- afs_int32 * cached, struct vcache *adp, char *aname)
+ struct vcache *adp, char *aname)
{
afs_int32 code, now, newvcache = 0;
struct VenusFid nfid;
afs_int32 retry;
AFS_STATCNT(afs_GetVCache);
- if (cached)
- *cached = 0; /* Init just in case */
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
loop1:
ObtainReadLock(&tvc->lock);
if (tvc->f.states & CStatd) {
- if (cached) {
- *cached = 1;
- }
ReleaseReadLock(&tvc->lock);
return tvc;
}
struct vcache *
afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq,
- afs_int32 * cached, struct volume *tvolp)
+ struct volume *tvolp)
{
afs_int32 code = 0, i, newvcache = 0, haveStatus = 0;
afs_int32 getNewFid = 0;
newvcache = 1;
afs_stats_cmperf.vcacheMisses++;
} else {
- if (cached)
- *cached = 1;
afs_stats_cmperf.vcacheHits++;
#if defined(AFS_DARWIN80_ENV)
/* we already bumped the ref count in the for loop above */
}
if (do_dnlc) {
- if ((avc->f.fid.Fid.Vnode & 1) || vType(avc) == VDIR ||
+ if ((avc->f.fid.Fid.Vnode & 1) ||
+ AFSTOV(avc) == NULL || vType(avc) == VDIR ||
(avc->f.states & CForeign)) {
/* This vcache is (or could be) a directory. */
osi_dnlc_purgedp(avc);