#ifdef AFS_OSF_ENV
afs_int32 afs_maxvcount = 0; /* max number of vcache entries */
afs_int32 afs_vcount = 0; /* number of vcache in use now */
-#if defined(AFS_OSF30_ENV)
-extern int max_vnodes; /* number of total system vnodes */
-#else
-extern int nvnode; /* number of total system vnodes */
-#endif
-#ifndef AFS_OSF30_ENV
-extern int numvnodes; /* number vnodes in use now */
-#endif
#endif /* AFS_OSF_ENV */
+
#ifdef AFS_SGI_ENV
int afsvnumbers = 0;
#endif
-/* Imported variables */
-extern struct server *afs_servers[NSERVERS];
-extern afs_rwlock_t afs_xserver;
-extern afs_rwlock_t afs_xcbhash;
-extern struct vcache *afs_globalVp;
-#ifdef AFS_OSF_ENV
-extern struct mount *afs_globalVFS;
-extern struct vnodeops Afs_vnodeops;
-#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
-extern struct mount *afs_globalVFS;
-#else
-extern struct vfs *afs_globalVFS;
-#endif /* AFS_OSF_ENV */
-#if defined(AFS_DUX40_ENV)
-extern struct vfs_ubcops afs_ubcops;
-#endif
-#ifdef AFS_SGI62_ENV
-extern struct vnodeops Afs_vnodeops;
-#endif
#ifdef AFS_SGI64_ENV
char *makesname();
#endif /* AFS_SGI64_ENV */
{ /*afs_FlushVCache*/
register afs_int32 i, code;
- register struct vcache **uvc, *wvc, *tvc;
+ register struct vcache **uvc, *wvc;
*slept = 0;
AFS_STATCNT(afs_FlushVCache);
if (afs_norefpanic) {
printf ("flush vc refcnt < 1");
afs_norefpanic++;
- (void) vgone(avc, VX_NOSLEEP, (struct vnodeops *) 0);
+ (void) vgone(avc, VX_NOSLEEP, NULL);
AFS_GLOCK();
VN_UNLOCK(AFSTOV(avc));
}
*/
void afs_InactiveVCache(struct vcache *avc, struct AFS_UCRED *acred)
{
- extern afs_rwlock_t afs_xdcache, afs_xvcache;
-
AFS_STATCNT(afs_inactive);
if (avc->states & CDirty) {
/* we can't keep trying to push back dirty data forever. Give up. */
* held, so we don't have to worry about blocking in osi_Alloc.
*/
static struct afs_cbr *afs_cbrSpace = 0;
-struct afs_cbr *afs_AllocCBR() {
+struct afs_cbr *afs_AllocCBR(void)
+{
register struct afs_cbr *tsp;
int i;
*
* Environment: the xvcb lock is held over these calls.
*/
-afs_FreeCBR(asp)
-register struct afs_cbr *asp; {
+int afs_FreeCBR(register struct afs_cbr *asp)
+{
asp->next = afs_cbrSpace;
afs_cbrSpace = asp;
return 0;
struct vrequest treq;
struct conn *tc;
int safety1, safety2, safety3;
- extern int afs_totalServers;
XSTATS_DECLS
- if (code = afs_InitReq(&treq, &afs_osi_cred)) return code;
+ if ((code = afs_InitReq(&treq, &afs_osi_cred))) return code;
treq.flags |= O_NONBLOCK;
if (lockit) MObtainWriteLock(&afs_xvcb,273);
return 0;
}
+
+/*
+ * afs_RemoveVCB
+ *
+ * Description:
+ * Remove a queued callback by looking through all the servers
+ * to see if any have this callback queued.
+ *
+ * Parameters:
+ * afid: The fid we want cleansed of queued callbacks.
+ *
+ * Environment:
+ * Locks xvcb and xserver locks.
+ * Typically called with xdcache, xvcache and/or individual vcache
+ * entries locked.
+ */
+
+int afs_RemoveVCB(register struct VenusFid *afid)
+{
+ register int i;
+ register struct server *tsp;
+ register struct afs_cbr *tcbrp;
+ struct afs_cbr **lcbrpp;
+
+ AFS_STATCNT(afs_RemoveVCB);
+ MObtainWriteLock(&afs_xvcb,275);
+ ObtainReadLock(&afs_xserver);
+ for(i=0;i<NSERVERS;i++) {
+ for(tsp=afs_servers[i]; tsp; tsp=tsp->next) {
+ /* if cell is known, and is wrong, then skip this server */
+ if (tsp->cell && tsp->cell->cell != afid->Cell) continue;
+
+ /*
+ * Otherwise, iterate through file IDs we're sending to the
+ * server.
+ */
+ lcbrpp = &tsp->cbrs; /* first queued return callback */
+ for(tcbrp = *lcbrpp; tcbrp; lcbrpp = &tcbrp->next, tcbrp = *lcbrpp) {
+ if (afid->Fid.Volume == tcbrp->fid.Volume &&
+ afid->Fid.Unique == tcbrp->fid.Unique &&
+ afid->Fid.Vnode == tcbrp->fid.Vnode) {
+ *lcbrpp = tcbrp->next; /* unthread from list */
+ afs_FreeCBR(tcbrp);
+ goto done;
+ }
+ }
+ }
+ }
+ done:
+ ReleaseReadLock(&afs_xserver);
+ MReleaseWriteLock(&afs_xvcb);
+ return 0;
+}
+
#ifdef AFS_LINUX22_ENV
static void __shrink_dcache_parent(struct dentry * parent)
#endif /* AFS_LINUX22_ENV */
/*
- * afs_RemoveVCB
- *
- * Description:
- * Remove a queued callback by looking through all the servers
- * to see if any have this callback queued.
- *
- * Parameters:
- * afid: The fid we want cleansed of queued callbacks.
- *
- * Environment:
- * Locks xvcb and xserver locks.
- * Typically called with xdcache, xvcache and/or individual vcache
- * entries locked.
- */
-
-afs_RemoveVCB(afid)
- register struct VenusFid *afid;
-
-{ /*afs_RemoveVCB*/
-
- register int i, j;
- register struct server *tsp;
- register struct afs_cbr *tcbrp;
- struct afs_cbr **lcbrpp;
-
- AFS_STATCNT(afs_RemoveVCB);
- MObtainWriteLock(&afs_xvcb,275);
- ObtainReadLock(&afs_xserver);
- for(i=0;i<NSERVERS;i++) {
- for(tsp=afs_servers[i]; tsp; tsp=tsp->next) {
- /* if cell is known, and is wrong, then skip this server */
- if (tsp->cell && tsp->cell->cell != afid->Cell) continue;
-
- /*
- * Otherwise, iterate through file IDs we're sending to the
- * server.
- */
- lcbrpp = &tsp->cbrs; /* first queued return callback */
- for(tcbrp = *lcbrpp; tcbrp; lcbrpp = &tcbrp->next, tcbrp = *lcbrpp) {
- if (afid->Fid.Volume == tcbrp->fid.Volume &&
- afid->Fid.Unique == tcbrp->fid.Unique &&
- afid->Fid.Vnode == tcbrp->fid.Vnode) {
- *lcbrpp = tcbrp->next; /* unthread from list */
- afs_FreeCBR(tcbrp);
- goto done;
- }
- }
- }
- }
- done:
- ReleaseReadLock(&afs_xserver);
- MReleaseWriteLock(&afs_xvcb);
- return 0;
-
-} /*afs_RemoveVCB*/
-
-
-/*
* afs_NewVCache
*
* Description:
* created.
*/
/* LOCK: afs_NewVCache afs_xvcache W */
-struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
- afs_int32 lockit, afs_int32 locktype)
+struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp)
{
struct vcache *tvc;
afs_int32 i;
AFS_GLOCK();
tvc = nvc;
- tvc->nextfree = (struct vcache *)0;
+ tvc->nextfree = NULL;
afs_vcount++;
#else /* AFS_OSF_ENV */
/* pull out a free cache entry */
tvc = QTOV(tq);
uq = QPrev(tq);
- if (tvc->states & CVFlushed)
+ if (tvc->states & CVFlushed) {
refpanic("CVFlushed on VLRU");
- else if (i++ > 2*afs_cacheStats) /* even allowing for a few xallocs...*/
+ } else if (i++ > 2*afs_cacheStats) { /* even allowing for a few xallocs...*/
refpanic("Increase -stat parameter of afsd(VLRU cycle?)");
- else if (QNext(uq) != tq)
+ } else if (QNext(uq) != tq) {
refpanic("VLRU inconsistent");
+ }
#ifdef AFS_DARWIN_ENV
if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) &&
else {
tvc = freeVCList; /* take from free list */
freeVCList = tvc->nextfree;
- tvc->nextfree = (struct vcache *)0;
+ tvc->nextfree = NULL;
}
#endif /* AFS_OSF_ENV */
tvc->v.v_vm_info->pager = MEMORY_OBJECT_NULL;
#endif /* AFS_MACH_ENV */
tvc->parentVnode = 0;
- tvc->mvid = (struct VenusFid *) 0;
- tvc->linkData = (char *) 0;
+ tvc->mvid = NULL;
+ tvc->linkData = NULL;
tvc->cbExpires = 0;
tvc->opens = 0;
tvc->execsOrWriters = 0;
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 = (struct SimpleLocks *)0;
+ tvc->slocks = NULL;
i = VCHash(afid);
tvc->hnext = afs_vhashT[i];
* doflocks : Do we handle flocks?
*/
/* LOCK: afs_FlushActiveVcaches afs_xvcache N */
-void
-afs_FlushActiveVcaches(doflocks)
- register afs_int32 doflocks;
-
-{ /*afs_FlushActiveVcaches*/
-
+void afs_FlushActiveVcaches(register afs_int32 doflocks)
+{
register struct vcache *tvc;
register int i;
register struct conn *tc;
register afs_int32 code;
- register struct AFS_UCRED *cred;
+ register struct AFS_UCRED *cred = NULL;
struct vrequest treq, ureq;
struct AFSVolSync tsync;
int didCore;
} while
(afs_Analyze(tc, code, &tvc->fid, &treq,
AFS_STATS_FS_RPCIDX_EXTENDLOCK,
- SHARED_LOCK, (struct cell *)0));
+ SHARED_LOCK, NULL));
ReleaseWriteLock(&tvc->lock);
ObtainReadLock(&afs_xvcache);
tvc->states &= ~CCore;
/* XXXX Find better place-holder for cred XXXX */
cred = (struct AFS_UCRED *) tvc->linkData;
- tvc->linkData = (char *) 0; /* XXX */
+ tvc->linkData = NULL; /* XXX */
afs_InitReq(&ureq, cred);
afs_Trace2(afs_iclSetp, CM_TRACE_ACTCCORE,
ICL_TYPE_POINTER, tvc,
}
}
ReleaseReadLock(&afs_xvcache);
-
-} /*afs_FlushActiveVcaches*/
+}
/*
}
ObtainWriteLock(&afs_xcbhash, 461);
avc->states &= ~( CStatd | CUnique );
- avc->callback = (struct server *)0;
+ avc->callback = NULL;
afs_DequeueCallback(avc);
ReleaseWriteLock(&afs_xcbhash);
ReleaseWriteLock(&avc->lock);
osi_dnlc_purgevp (avc);
/* fetch the status info */
- tvc = afs_GetVCache(&avc->fid, areq, (afs_int32*)0, avc, READ_LOCK);
+ tvc = afs_GetVCache(&avc->fid, areq, NULL, avc);
if (!tvc) return ENOENT;
/* Put it back; caller has already incremented vrefCount */
- afs_PutVCache(tvc, READ_LOCK);
+ afs_PutVCache(tvc);
return 0;
} /*afs_VerifyVCache*/
*
* Callers: as of 1992-04-29, only called by WriteVCache
*/
-static void
-afs_SimpleVStat(avc, astat, areq)
- register struct vcache *avc;
- register struct AFSFetchStatus *astat;
- struct vrequest *areq;
-{ /*afs_SimpleVStat*/
-
+static void afs_SimpleVStat(register struct vcache *avc,
+ register struct AFSFetchStatus *astat, struct vrequest *areq)
+{
afs_size_t length;
AFS_STATCNT(afs_SimpleVStat);
*/
#endif /* badidea */
if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid)))
- ac->axess = astat->CallerAccess;
+ ac->axess = astat->CallerAccess;
else /* not found, add a new one if possible */
afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess);
}
* Must be called with a shared lock held on the vnode.
*/
-afs_WriteVCache(avc, astatus, areq)
- register struct vcache *avc;
- register struct AFSStoreStatus *astatus;
- struct vrequest *areq;
-
-{ /*afs_WriteVCache*/
+int afs_WriteVCache(register struct vcache *avc,
+ register struct AFSStoreStatus *astatus, struct vrequest *areq)
+{
afs_int32 code;
struct conn *tc;
struct AFSFetchStatus OutStatus;
} while
(afs_Analyze(tc, code, &avc->fid, areq,
AFS_STATS_FS_RPCIDX_STORESTATUS,
- SHARED_LOCK, (struct cell *)0));
+ SHARED_LOCK, NULL));
UpgradeSToWLock(&avc->lock,20);
if (code == 0) {
* been modified. This is less than ideal. I haven't thought about
* it sufficiently to be certain that it is adequate.
*/
-void
-afs_ProcessFS(avc, astat, areq)
- register struct vcache *avc;
- struct vrequest *areq;
- register struct AFSFetchStatus *astat;
-
-{ /*afs_ProcessFS*/
-
- register int i;
+void afs_ProcessFS(register struct vcache *avc, register struct AFSFetchStatus *astat,
+ struct vrequest *areq)
+{
afs_size_t length;
AFS_STATCNT(afs_ProcessFS);
{
struct axscache *ac;
if (avc->Access && (ac = afs_FindAxs(avc->Access, areq->uid)))
- ac->axess = astat->CallerAccess;
+ ac->axess = astat->CallerAccess;
else /* not found, add a new one if possible */
afs_AddAxs(avc->Access, areq->uid, astat->CallerAccess);
}
} /*afs_ProcessFS*/
-afs_RemoteLookup(afid, areq, name, nfid, OutStatusp, CallBackp, serverp, tsyncp)
- register struct VenusFid *afid;
- struct vrequest *areq;
- char *name;
- struct VenusFid *nfid;
- struct AFSFetchStatus *OutStatusp;
- struct AFSCallBack *CallBackp;
- struct server **serverp;
- struct AFSVolSync *tsyncp;
+int afs_RemoteLookup(register struct VenusFid *afid, struct vrequest *areq,
+ char *name, struct VenusFid *nfid, struct AFSFetchStatus *OutStatusp,
+ struct AFSCallBack *CallBackp, struct server **serverp, struct AFSVolSync *tsyncp)
{
- afs_int32 code, i;
- register struct vcache *tvc;
- struct volume *tvp;
+ afs_int32 code;
afs_uint32 start;
register struct conn *tc;
struct AFSFetchStatus OutDirStatus;
} while
(afs_Analyze(tc, code, afid, areq,
AFS_STATS_FS_RPCIDX_XLOOKUP,
- SHARED_LOCK, (struct cell *)0));
+ SHARED_LOCK, NULL));
return code;
}
* locking directories in a constant order.
* NB. NewVCache -> FlushVCache presently (4/10/95) drops the xvcache lock.
*/
-struct vcache *afs_GetVCache(afid, areq, cached, avc, locktype)
- register struct VenusFid *afid;
- struct vrequest *areq;
- afs_int32 *cached;
- afs_int32 locktype;
- struct vcache *avc; /* might have a vcache structure already, which must
+ /* might have a vcache structure already, which must
* already be held by the caller */
-{ /*afs_GetVCache*/
- afs_int32 code, i, newvcache=0;
+struct vcache *afs_GetVCache(register struct VenusFid *afid, struct vrequest *areq,
+ afs_int32 *cached, struct vcache *avc)
+{
+
+ afs_int32 code, newvcache=0;
register struct vcache *tvc;
struct volume *tvp;
afs_int32 retry;
if (cached) *cached = 0; /* Init just in case */
+#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
loop:
+#endif
+
ObtainSharedLock(&afs_xvcache,5);
- tvc = afs_FindVCache(afid, 0, 0, &retry, DO_STATS | DO_VLRU );
+ tvc = afs_FindVCache(afid, &retry, DO_STATS | DO_VLRU );
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
UpgradeSToWLock(&afs_xvcache,21);
/* no cache entry, better grab one */
- tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK);
+ tvc = afs_NewVCache(afid, NULL);
newvcache = 1;
ConvertWToSLock(&afs_xvcache);
ObtainReadLock(&afs_xvcache);
AFS_FAST_RELE(tvc);
ReleaseReadLock(&afs_xvcache);
- return (struct vcache *) 0;
+ return NULL;
}
ReleaseWriteLock(&tvc->lock);
struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq,
- afs_int32 *cached, afs_int32 locktype,
- struct vcache *adp, char *aname)
+ afs_int32 *cached, struct vcache *adp, char *aname)
{
- afs_int32 code, now, newvcache=0, hash;
+ afs_int32 code, now, newvcache=0;
struct VenusFid nfid;
register struct vcache *tvc;
struct volume *tvp;
AFS_STATCNT(afs_GetVCache);
if (cached) *cached = 0; /* Init just in case */
+#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
loop1:
+#endif
+
ObtainReadLock(&afs_xvcache);
- tvc = afs_FindVCache(afid, 0, 0, &retry, DO_STATS /* no vlru */);
+ tvc = afs_FindVCache(afid, &retry, DO_STATS /* no vlru */);
if (tvc) {
ReleaseReadLock(&afs_xvcache);
code = afs_RemoteLookup(&adp->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, 0, 0, &retry, DO_VLRU /* no xstats now*/);
+ tvc = afs_FindVCache(&nfid, &retry, DO_VLRU /* no xstats now*/);
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
if (!tvc) {
/* no cache entry, better grab one */
UpgradeSToWLock(&afs_xvcache,22);
- tvc = afs_NewVCache(&nfid, (struct server *)0, 1, WRITE_LOCK);
+ tvc = afs_NewVCache(&nfid, NULL);
newvcache = 1;
ConvertWToSLock(&afs_xvcache);
}
ObtainReadLock(&afs_xvcache);
AFS_FAST_RELE(tvc);
ReleaseReadLock(&afs_xvcache);
- return (struct vcache *) 0;
+ return NULL;
}
ObtainWriteLock(&afs_xcbhash, 466);
tvc->states &= ~CBulkFetching;
afs_QueueCallback(tvc, CBHash(3600), tvp);
} else {
- tvc->callback = (struct server *)0;
+ tvc->callback = NULL;
afs_DequeueCallback(tvc);
tvc->states &= ~(CStatd | CUnique);
if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1))
afs_DequeueCallback(tvc);
tvc->states &= ~CStatd;
tvc->states &= ~CUnique;
- tvc->callback = (struct server *)0;
+ tvc->callback = NULL;
if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp (tvc); /* if it (could be) a directory */
}
struct vcache *afs_GetRootVCache(struct VenusFid *afid,
struct vrequest *areq, afs_int32 *cached,
- struct volume *tvolp, afs_int32 locktype)
+ struct volume *tvolp)
{
- afs_int32 code, i, newvcache = 0, haveStatus = 0;
+ afs_int32 code = 0, i, newvcache = 0, haveStatus = 0;
afs_int32 getNewFid = 0;
afs_uint32 start;
struct VenusFid nfid;
struct AFSFetchStatus OutStatus;
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
- int origCBs;
+ int origCBs = 0;
start = osi_Time();
tfid = *afid;
tfid.Fid.Vnode = 0; /* Means get rootfid of volume */
origCBs = afs_allCBs; /* ignore InitCallBackState */
- code = afs_RemoteLookup(&tfid, areq, (char *)0, &nfid,
+ code = afs_RemoteLookup(&tfid, areq, NULL, &nfid,
&OutStatus, &CallBack, &serverp, &tsync);
if (code) {
- return (struct vcache *)0;
+ return NULL;
}
/* ReleaseReadLock(&tvolp->lock); */
ObtainWriteLock(&tvolp->lock,56);
if (!tvc) {
UpgradeSToWLock(&afs_xvcache,23);
/* no cache entry, better grab one */
- tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK);
+ tvc = afs_NewVCache(afid, NULL);
newvcache = 1;
afs_stats_cmperf.vcacheMisses++;
}
ObtainReadLock(&tvc->lock);
tvc->states &= ~CUnique;
- tvc->callback = (struct server *)0; /* redundant, perhaps */
+ tvc->callback = NULL; /* redundant, perhaps */
ReleaseReadLock(&tvc->lock);
}
tfid = *afid;
tfid.Fid.Vnode = 0; /* Means get rootfid of volume */
origCBs = afs_allCBs; /* ignore InitCallBackState */
- code = afs_RemoteLookup(&tfid, areq, (char *)0, &nfid, &OutStatus,
+ code = afs_RemoteLookup(&tfid, areq, NULL, &nfid, &OutStatus,
&CallBack, &serverp, &tsync);
}
if (code) {
ObtainWriteLock(&afs_xcbhash, 467);
afs_DequeueCallback(tvc);
- tvc->callback = (struct server *)0;
+ tvc->callback = NULL;
tvc->states &= ~(CStatd|CUnique);
ReleaseWriteLock(&afs_xcbhash);
if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1))
ObtainReadLock(&afs_xvcache);
AFS_FAST_RELE(tvc);
ReleaseReadLock(&afs_xvcache);
- return (struct vcache *) 0;
+ return NULL;
}
ObtainWriteLock(&afs_xcbhash, 468);
}
} else {
afs_DequeueCallback(tvc);
- tvc->callback = (struct server *)0;
+ tvc->callback = NULL;
tvc->states &= ~(CStatd | CUnique);
if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp (tvc); /* if it (could be) a directory */
struct vrequest *areq, struct AFSFetchStatus *Outsp)
{
int code;
- afs_uint32 start;
+ afs_uint32 start = 0;
register struct conn *tc;
struct AFSCallBack CallBack;
struct AFSVolSync tsync;
} while
(afs_Analyze(tc, code, afid, areq,
AFS_STATS_FS_RPCIDX_FETCHSTATUS,
- SHARED_LOCK, (struct cell *)0));
+ SHARED_LOCK, NULL));
if (!code) {
afs_ProcessFS(avc, Outsp, areq);
}
else {
afs_DequeueCallback(avc);
- avc->callback = (struct server *)0;
+ avc->callback = NULL;
avc->states &= ~(CStatd|CUnique);
if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp (avc); /* if it (could be) a directory */
}
else {
afs_DequeueCallback(avc);
- avc->callback = (struct server *)0;
+ avc->callback = NULL;
avc->states &= ~(CStatd|CUnique);
if ((avc->states & CForeign) || (avc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp (avc); /* if it (could be) a directory */
* Environment:
* Nothing interesting.
*/
-void
-afs_StuffVcache(afid, OutStatus, CallBack, tc, areq)
- register struct VenusFid *afid;
- struct AFSFetchStatus *OutStatus;
- struct AFSCallBack *CallBack;
- register struct conn *tc;
- struct vrequest *areq;
-
-{ /*afs_StuffVcache*/
-
+void afs_StuffVcache(register struct VenusFid *afid,
+ struct AFSFetchStatus *OutStatus, struct AFSCallBack *CallBack,
+ register struct conn *tc, struct vrequest *areq)
+{
register afs_int32 code, i, newvcache=0;
register struct vcache *tvc;
struct AFSVolSync tsync;
loop:
ObtainSharedLock(&afs_xvcache,8);
- tvc = afs_FindVCache(afid, 0, 0, &retry, DO_VLRU /* no stats */);
+ tvc = afs_FindVCache(afid, &retry, DO_VLRU /* no stats */);
if (tvc && retry) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
ReleaseSharedLock(&afs_xvcache);
if (!tvc) {
/* no cache entry, better grab one */
UpgradeSToWLock(&afs_xvcache,25);
- tvc = afs_NewVCache(afid, (struct server *)0, 1, WRITE_LOCK);
+ tvc = afs_NewVCache(afid, NULL);
newvcache = 1;
ConvertWToSLock(&afs_xvcache);
}
}
else {
afs_DequeueCallback(tvc);
- tvc->callback = (struct server *)0;
+ tvc->callback = NULL;
tvc->states &= ~(CStatd|CUnique);
if ((tvc->states & CForeign) || (tvc->fid.Fid.Vnode & 1))
osi_dnlc_purgedp (tvc); /* if it (could be) a directory */
/*
* Release ref count... hope this guy stays around...
*/
- afs_PutVCache(tvc, WRITE_LOCK);
+ afs_PutVCache(tvc);
} /*afs_StuffVcache*/
#endif
* Environment:
* Nothing interesting.
*/
-void
-afs_PutVCache(avc, locktype)
- register struct vcache *avc;
- afs_int32 locktype;
-{ /*afs_PutVCache*/
-
+void afs_PutVCache(register struct vcache *avc)
+{
AFS_STATCNT(afs_PutVCache);
/*
* Can we use a read lock here?
* must be shared-- we upgrade it here.
*/
-struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit,
- afs_int32 locktype, afs_int32 *retry, afs_int32 flag)
+struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 *retry, afs_int32 flag)
{
register struct vcache *tvc;
int afs_duplicate_nfs_fids=0;
-afs_int32 afs_NFSFindVCache(avcp, afid, lockit)
- struct vcache **avcp;
- struct VenusFid *afid;
- afs_int32 lockit;
-{ /*afs_FindVCache*/
-
+afs_int32 afs_NFSFindVCache(struct vcache **avcp, struct VenusFid *afid)
+{
register struct vcache *tvc;
afs_int32 i;
- afs_int32 retry = 0;
afs_int32 count = 0;
struct vcache *found_tvc = NULL;
AFS_STATCNT(afs_FindVCache);
+#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
loop:
+#endif
ObtainSharedLock(&afs_xvcache,331);
/* should I have a read lock on the vnode here? */
if (tvc) {
#if defined(AFS_SGI_ENV) && !defined(AFS_SGI53_ENV)
+ afs_int32 retry = 0;
osi_vnhold(tvc, &retry);
if (retry) {
count = 0;
}
}
#else /* AFS_OSF_ENV */
- freeVCList = (struct vcache *)0;
+ freeVCList = NULL;
#endif
RWLOCK_INIT(&afs_xvcache, "afs_xvcache");
for(i=0; i < astatSize-1; i++) {
tvp[i].nextfree = &(tvp[i+1]);
}
- tvp[astatSize-1].nextfree = (struct vcache *) 0;
+ tvp[astatSize-1].nextfree = NULL;
#ifdef AFS_AIX32_ENV
pin((char *)tvp, astatSize * sizeof(struct vcache)); /* XXX */
#endif