#define afs_CheckRXEpoch() {if (rxepoch_checked == 0 && rxkad_EpochWasSet) { \
rxepoch_checked = 1; afs_GCUserData(/* force flag */ 1); } }
-extern int afsd_dynamic_vcaches;
-
/* PAG garbage collection */
/* We induce a compile error if param.h does not define AFS_GCPAGS */
afs_int32 afs_gcpags = AFS_GCPAGS;
* tickets */
last3MinCheck = now;
}
-#ifdef AFS_MAXVCOUNT_ENV
- if (afsd_dynamic_vcaches && (last5MinCheck + 300 < now)) {
- /* start with trying to drop us back to our base usage */
- int anumber;
- if (afs_maxvcount <= afs_cacheStats)
- anumber = VCACHE_FREE;
- else
- anumber = VCACHE_FREE + (afs_maxvcount - afs_cacheStats);
-
- afs_ShakeLooseVCaches(anumber);
- last5MinCheck = now;
- }
-#endif
+
+ if (afsd_dynamic_vcaches && (last5MinCheck + 300 < now)) {
+ /* start with trying to drop us back to our base usage */
+ int anumber;
+ if (afs_maxvcount <= afs_cacheStats)
+ anumber = VCACHE_FREE;
+ else
+ anumber = VCACHE_FREE + (afs_maxvcount - afs_cacheStats);
+
+ afs_ShakeLooseVCaches(anumber);
+ last5MinCheck = now;
+ }
+
if (!afs_CheckServerDaemonStarted) {
/* Do the check here if the correct afsd is not installed. */
if (!cs_warned) {
#endif
/* This is the kernel side of the dynamic vcache setting */
+#ifdef AFS_MAXVCOUNT_ENV
int afsd_dynamic_vcaches = 0; /* Enable dynamic-vcache support */
+#endif
/*
* Initialization order is important. Must first call afs_CacheInit,
#endif /* SYS_NAME_ID */
#ifdef AFS_MAXVCOUNT_ENV
- afsd_dynamic_vcaches = dynamic_vcaches;
- printf("%s dynamically allocated vcaches\n", ( afsd_dynamic_vcaches ? "enabling" : "disabling" ));
-#else
- afsd_dynamic_vcaches = 0;
+ afsd_dynamic_vcaches = dynamic_vcaches;
+ printf("%s dynamically allocated vcaches\n",
+ ( afsd_dynamic_vcaches ? "enabling" : "disabling" ));
#endif
printf("Starting AFS cache scan...");
static struct afs_cbr *afs_cbrHashT[CBRSIZE];
afs_int32 afs_bulkStatsLost;
int afs_norefpanic = 0;
-extern int afsd_dynamic_vcaches;
/* Disk backed vcache definitions
AFS_GLOCK();
}
- if (
-#ifdef AFS_MAXVCOUNT_ENV
- afsd_dynamic_vcaches || /* Always run if dynamic vcaches are enabled. */
-#endif
- afs_vcount >= afs_maxvcount
- ) {
+ if (afsd_dynamic_vcaches || afs_vcount >= afs_maxvcount) {
i = 0;
for (tq = VLRU.prev; tq != &VLRU && anumber > 0; tq = uq) {
tvc = QTOV(tq);
uq = QPrev(tq);
if (tvc->f.states & CVFlushed) {
refpanic("CVFlushed on VLRU");
- } else if (
-#ifdef AFS_MAXVCOUNT_ENV
- ! afsd_dynamic_vcaches &&
-#endif
- i++ > afs_maxvcount) {
+ } else if (!afsd_dynamic_vcaches && i++ > afs_maxvcount) {
refpanic("Exceeded pool of AFS vnodes(VLRU cycle?)");
} else if (QNext(uq) != tq) {
refpanic("VLRU inconsistent");
if (tq == uq)
break;
}
- if (
-#ifdef AFS_MAXVCOUNT_ENV
- !afsd_dynamic_vcaches &&
-#endif
- anumber == target) {
+ if (!afsd_dynamic_vcaches && anumber == target) {
printf("afs_ShakeLooseVCaches: warning none freed, using %d of %d\n",
afs_vcount, afs_maxvcount);
}
#endif
afs_vcount++;
-#ifdef AFS_MAXVCOUNT_ENV
+
/* track the peak */
if (afsd_dynamic_vcaches && afs_maxvcount < afs_vcount) {
afs_maxvcount = afs_vcount;
/*printf("peak vnodes: %d\n", afs_maxvcount);*/
}
-#endif
+
afs_stats_cmperf.vcacheXAllocs++; /* count in case we have a leak */
#else
/* none free, making one is better than a panic */
afs_FlushReclaimedVcaches();
#if defined(AFS_OSF_ENV) || defined(AFS_LINUX22_ENV)
-#ifdef AFS_MAXVCOUNT_ENV
if(!afsd_dynamic_vcaches) {
-#endif
afs_ShakeLooseVCaches(anumber);
if (afs_vcount >= afs_maxvcount) {
printf("afs_NewVCache - none freed\n");
return NULL;
}
-#ifdef AFS_MAXVCOUNT_ENV
}
-#endif
tvc = afs_AllocVCache();
#else /* AFS_OSF_ENV */
/* pull out a free cache entry */