afid.Fid.Unique = ntohl(de->fid.vunique);
if ((avc->f.states & CForeign) == 0 && (ntohl(de->fid.vnode) & 1)) {
type = DT_DIR;
- } else if ((tvc = afs_FindVCache(&afid, 0, 0))) {
+ } else if ((tvc = afs_FindVCache(&afid, 0))) {
if (tvc->mvstat != AFS_MVSTAT_FILE) {
type = DT_DIR;
} else if (((tvc->f.states) & (CStatd | CTruth))) {
* freeing of the vnode will change evenZaps. Don't need to update the VLRU
* queue, since the find will only succeed in the event of a create race, and
* then the vcache will be at the front of the VLRU queue anyway... */
- if (!(tvc = afs_FindVCache(&newFid, 0, DO_STATS))) {
+ if (!(tvc = afs_FindVCache(&newFid, DO_STATS))) {
tvc = afs_NewVCache(&newFid, hostp);
if (tvc) {
int finalCBs;
afs_LookupVCache(&unlinkFid, treq, adp, aname);
} else {
ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(&unlinkFid, 0, 1 /* do xstats */ );
+ tvc = afs_FindVCache(&unlinkFid, 1 /* do xstats */ );
ReleaseReadLock(&afs_xvcache);
}
}
code = afs_dir_Lookup(tdc, aname, &tfid.Fid);
ObtainSharedLock(&afs_xvcache, 764);
- tvc = afs_FindVCache(&tfid, 0, 1 /* do xstats */ );
+ tvc = afs_FindVCache(&tfid, 1 /* do xstats */ );
ReleaseSharedLock(&afs_xvcache);
if (!tvc) {
}
if (tvc->mvid.target_root && (tvc->f.states & CMValid)) {
if (!canblock) {
- afs_int32 retry;
-
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- root_vp = afs_FindVCache(tvc->mvid.target_root, &retry, 0);
- if (root_vp && retry) {
- ReleaseReadLock(&afs_xvcache);
- afs_PutVCache(root_vp);
- }
- } while (root_vp && retry);
+ ObtainReadLock(&afs_xvcache);
+ root_vp = afs_FindVCache(tvc->mvid.target_root, 0);
ReleaseReadLock(&afs_xvcache);
} else {
root_vp = afs_GetVCache(tvc->mvid.target_root, areq);
int i;
struct VenusFid afid; /* file ID we are using now */
struct VenusFid tfid; /* another temp. file ID */
- afs_int32 retry; /* handle low-level SGI MP race conditions */
+ afs_int32 retry; /* handle low-level VFS race conditions */
long volStates; /* flags from vol structure */
struct volume *volp = 0; /* volume ptr */
struct VenusFid dotdot = {0, {0, 0, 0}};
tfid.Fid.Volume = adp->f.fid.Fid.Volume;
tfid.Fid.Vnode = ntohl(dirEntryp->fid.vnode);
tfid.Fid.Unique = ntohl(dirEntryp->fid.vunique);
- do {
- retry = 0;
- ObtainSharedLock(&afs_xvcache, 130);
- tvcp = afs_FindVCache(&tfid, &retry, IS_SLOCK /* no stats | LRU */ );
- if (tvcp && retry) {
- ReleaseSharedLock(&afs_xvcache);
- afs_PutVCache(tvcp);
- }
- } while (tvcp && retry);
+ ObtainSharedLock(&afs_xvcache, 130);
+ tvcp = afs_FindVCache(&tfid, IS_SLOCK /* no stats | LRU */ );
if (!tvcp) { /* otherwise, create manually */
UpgradeSToWLock(&afs_xvcache, 129);
tvcp = afs_NewBulkVCache(&tfid, hostp, statSeqNo);
afid.Fid.Vnode = fidsp[i].Vnode;
afid.Fid.Unique = fidsp[i].Unique;
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- tvcp = afs_FindVCache(&afid, &retry, 0 /* !stats&!lru */);
- ReleaseReadLock(&afs_xvcache);
- } while (tvcp && retry);
+ ObtainReadLock(&afs_xvcache);
+ tvcp = afs_FindVCache(&afid, 0 /* !stats&!lru */);
+ ReleaseReadLock(&afs_xvcache);
if (!tvcp) {
continue;
afid.Fid.Volume = adp->f.fid.Fid.Volume;
afid.Fid.Vnode = fidsp[i].Vnode;
afid.Fid.Unique = fidsp[i].Unique;
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- tvcp = afs_FindVCache(&afid, &retry, 0/* !stats&!lru */);
- ReleaseReadLock(&afs_xvcache);
- } while (tvcp && retry);
+
+ ObtainReadLock(&afs_xvcache);
+ tvcp = afs_FindVCache(&afid, 0/* !stats&!lru */);
+ ReleaseReadLock(&afs_xvcache);
/* The entry may no longer exist */
if (tvcp == NULL) {
afid.Fid.Volume = adp->f.fid.Fid.Volume;
afid.Fid.Vnode = fidsp[i].Vnode;
afid.Fid.Unique = fidsp[i].Unique;
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- tvcp = afs_FindVCache(&afid, &retry, 0 /* !stats&!lru */);
- ReleaseReadLock(&afs_xvcache);
- } while (tvcp && retry);
+
+ ObtainReadLock(&afs_xvcache);
+ tvcp = afs_FindVCache(&afid, 0 /* !stats&!lru */);
+ ReleaseReadLock(&afs_xvcache);
if (tvcp != NULL) {
if ((tvcp->f.states & CBulkFetching)
&& (tvcp->f.m.Length == statSeqNo)) {
* dirCookie tells us where to start prefetching from.
*/
if (afs_ShouldTryBulkStat(adp)) {
- afs_int32 retry;
/* if the entry is not in the cache, or is in the cache,
* but hasn't been statd, then do a bulk stat operation.
*/
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(&tfid, &retry, 0 /* !stats,!lru */ );
- ReleaseReadLock(&afs_xvcache);
- } while (tvc && retry);
+ ObtainReadLock(&afs_xvcache);
+ tvc = afs_FindVCache(&tfid, 0 /* !stats,!lru */ );
+ ReleaseReadLock(&afs_xvcache);
if (!tvc || !(tvc->f.states & CStatd))
bulkcode = afs_DoBulkStat(adp, dirCookie, treq);
return DT_DIR;
}
ObtainReadLock(&afs_xvcache);
- if ((tvc = afs_FindVCache(&tfid, 0, 0))) {
+ if ((tvc = afs_FindVCache(&tfid, 0))) {
ReleaseReadLock(&afs_xvcache);
if (tvc->mvstat != AFS_MVSTAT_FILE) {
afs_PutVCache(tvc);
aname);
} else {
ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(&unlinkFid, 0, DO_STATS);
+ tvc = afs_FindVCache(&unlinkFid, DO_STATS);
ReleaseReadLock(&afs_xvcache);
}
}
fileFid.Cell = aodp->f.fid.Cell;
fileFid.Fid.Volume = aodp->f.fid.Fid.Volume;
ObtainSharedLock(&afs_xvcache, 754);
- tvc = afs_FindVCache(&fileFid, 0 , 1);
+ tvc = afs_FindVCache(&fileFid, 1);
ReleaseSharedLock(&afs_xvcache);
if (tvc) {
if (tvp) {
struct vcache *tvc;
ObtainReadLock(&afs_xvcache);
- if ((tvc = afs_FindVCache(afid, 0, 0))) {
+ if ((tvc = afs_FindVCache(afid, 0))) {
ReleaseReadLock(&afs_xvcache);
afs_StaleVCacheFlags(tvc, AFS_STALEVC_NOCB | AFS_STALEVC_NODNLC,
CUnique);
/* xdcache is lower than the xvcache lock */
ReleaseWriteLock(&afs_xdcache);
ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(afid, 0, 0 /* no stats, no vlru */ );
+ tvc = afs_FindVCache(afid, 0 /* no stats, no vlru */ );
ReleaseReadLock(&afs_xvcache);
ObtainWriteLock(&afs_xdcache, 527);
skip = 0;
/* Get the parent dir's vcache that contains the shadow fid. */
ObtainSharedLock(&afs_xvcache, 755);
- parent_vc = afs_FindVCache(&parent_fid, 0, 1);
+ parent_vc = afs_FindVCache(&parent_fid, 1);
ReleaseSharedLock(&afs_xvcache);
if (!parent_vc) {
return ENETDOWN;
tfid.Fid.Unique = unique;
ObtainSharedLock(&afs_xvcache, 757);
- tvc = afs_FindVCache(&tfid, 0, 1);
+ tvc = afs_FindVCache(&tfid, 1);
ReleaseSharedLock(&afs_xvcache);
/* Count unfinished dirty children. */
/* Get the vcache. */
ObtainSharedLock(&afs_xvcache, 759);
- tvc = afs_FindVCache(&tfid, 0, 1);
+ tvc = afs_FindVCache(&tfid, 1);
ReleaseSharedLock(&afs_xvcache);
/* Change the fields. */
}
ObtainSharedLock(&afs_xvcache, 766);
- *adp = afs_FindVCache(afid, 0, 1);
+ *adp = afs_FindVCache(afid, 1);
ReleaseSharedLock(&afs_xvcache);
if (!*adp) {
/* printf("afs_GetParentVCache: Couldn't find parent dir's vcache\n"); */
/* Is this a used vnode? */
ObtainSharedLock(&afs_xvcache, 762);
- tvc = afs_FindVCache(afid, 0, 1);
+ tvc = afs_FindVCache(afid, 1);
ReleaseSharedLock(&afs_xvcache);
if (tvc)
afs_PutVCache(tvc);
void
afs_DynrootInvalidate(void)
{
- afs_int32 retry;
struct vcache *tvc;
struct VenusFid tfid;
ReleaseWriteLock(&afs_dynrootDirLock);
afs_GetDynrootFid(&tfid);
- do {
- retry = 0;
- ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(&tfid, &retry, 0);
- ReleaseReadLock(&afs_xvcache);
- } while (retry);
+ ObtainReadLock(&afs_xvcache);
+ tvc = afs_FindVCache(&tfid, 0);
+ ReleaseReadLock(&afs_xvcache);
if (tvc) {
afs_StaleVCacheFlags(tvc, AFS_STALEVC_NOCB, CUnique);
afs_PutVCache(tvc);
extern void afs_FlushReclaimedVcaches(void);
void afs_vcacheInit(int astatSize);
-extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 * retry,
- afs_int32 flag);
+extern struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 flag);
extern void afs_BadFetchStatus(struct afs_conn *tc);
extern int afs_CheckFetchStatus(struct afs_conn *tc,
struct AFSFetchStatus *status);
afs_int32 code, newvcache = 0;
struct vcache *tvc;
struct volume *tvp;
- afs_int32 retry;
AFS_STATCNT(afs_GetVCache);
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- loop:
-#endif
-
ObtainSharedLock(&afs_xvcache, 5);
- tvc = afs_FindVCache(afid, &retry, DO_STATS | DO_VLRU | IS_SLOCK);
- if (tvc && retry) {
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- ReleaseSharedLock(&afs_xvcache);
- spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD);
- goto loop;
-#endif
- }
+ tvc = afs_FindVCache(afid, DO_STATS | DO_VLRU | IS_SLOCK);
if (tvc) {
osi_Assert((tvc->f.states & CVInit) == 0);
/* If we are in readdir, return the vnode even if not statd */
struct AFSVolSync tsync;
struct server *serverp = 0;
afs_int32 origCBs;
- afs_int32 retry;
AFS_STATCNT(afs_GetVCache);
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- loop1:
-#endif
-
ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(afid, &retry, DO_STATS /* no vlru */ );
+ tvc = afs_FindVCache(afid, DO_STATS /* no vlru */ );
if (tvc) {
ReleaseReadLock(&afs_xvcache);
- if (retry) {
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD);
- goto loop1;
-#endif
- }
ObtainReadLock(&tvc->lock);
if (tvc->f.states & CStatd) {
afs_RemoteLookup(&adp->f.fid, areq, aname, &nfid, &OutStatus,
&CallBack, &serverp, &tsync);
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- loop2:
-#endif
-
ObtainSharedLock(&afs_xvcache, 6);
- tvc = afs_FindVCache(&nfid, &retry, DO_VLRU | IS_SLOCK/* no xstats now */ );
- if (tvc && retry) {
-#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
- ReleaseSharedLock(&afs_xvcache);
- spunlock_psema(tvc->v.v_lock, retry, &tvc->v.v_sync, PINOD);
- goto loop2;
-#endif
- }
-
+ tvc = afs_FindVCache(&nfid, DO_VLRU | IS_SLOCK/* no xstats now */ );
if (!tvc) {
/* no cache entry, better grab one */
UpgradeSToWLock(&afs_xvcache, 22);
* Find a vcache entry given a fid.
*
* \param afid Pointer to the fid whose cache entry we desire.
- * \param retry (SGI-specific) tell the caller to drop the lock on xvcache,
- * unlock the vnode, and try again.
* \param flag Bit 1 to specify whether to compute hit statistics. Not
* set if FindVCache is called as part of internal bookkeeping.
*
*/
struct vcache *
-afs_FindVCache(struct VenusFid *afid, afs_int32 * retry, afs_int32 flag)
+afs_FindVCache(struct VenusFid *afid, afs_int32 flag)
{
struct vcache *tvc;
*
* \param avcp Fill in pointer if we found one and only one.
* \param afid Pointer to the fid whose cache entry we desire.
- * \param retry (SGI-specific) tell the caller to drop the lock on xvcache,
- * unlock the vnode, and try again.
* \param flags bit 1 to specify whether to compute hit statistics. Not
* set if FindVCache is called as part of internal bookkeeping.
*