afs_int32 afs_gcpags_procsize = 0;
afs_int32 afs_CheckServerDaemonStarted = 0;
-#ifdef DEFAULT_PROBE_INTERVAL
-afs_int32 PROBE_INTERVAL = DEFAULT_PROBE_INTERVAL; /* overridding during compile */
-#else
-afs_int32 PROBE_INTERVAL = 180; /* default to 3 min */
+#ifndef DEFAULT_PROBE_INTERVAL
+#define DEFAULT_PROBE_INTERVAL 180 /* default to 3 min */
#endif
+afs_int32 afs_probe_interval = DEFAULT_PROBE_INTERVAL;
+afs_int32 afs_probe_all_interval = 600;
-#define PROBE_WAIT() (1000 * (PROBE_INTERVAL - ((afs_random() & 0x7fffffff) \
- % (PROBE_INTERVAL/2))))
+#define PROBE_WAIT() (1000 * (afs_probe_interval - ((afs_random() & 0x7fffffff) \
+ % (afs_probe_interval/2))))
void
afs_CheckServerDaemon(void)
}
now = osi_Time();
- if (PROBE_INTERVAL + lastCheck <= now) {
+ if (afs_probe_interval + lastCheck <= now) {
afs_CheckServers(1, NULL); /* check down servers */
lastCheck = now = osi_Time();
}
- if (600 + last10MinCheck <= now) {
- afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, 600);
+ if (afs_probe_all_interval + last10MinCheck <= now) {
+ afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, afs_probe_all_interval);
afs_CheckServers(0, NULL);
last10MinCheck = now = osi_Time();
}
}
/* Compute time to next probe. */
- delay = PROBE_INTERVAL + lastCheck;
- if (delay > 600 + last10MinCheck)
- delay = 600 + last10MinCheck;
+ delay = afs_probe_interval + lastCheck;
+ if (delay > afs_probe_all_interval + last10MinCheck)
+ delay = afs_probe_all_interval + last10MinCheck;
delay -= now;
if (delay < 1)
delay = 1;
cs_warned = 1;
printf("Please install afsd with check server daemon.\n");
}
- if (lastNMinCheck + PROBE_INTERVAL < now) {
+ if (lastNMinCheck + afs_probe_interval < now) {
/* only check down servers */
afs_CheckServers(1, NULL);
lastNMinCheck = now;
pcheck = (struct chservinfo *)ain;
if (pcheck->tinterval >= 0) {
cp = aout;
- memcpy(cp, (char *)&PROBE_INTERVAL, sizeof(afs_int32));
+ memcpy(cp, (char *)&afs_probe_interval, sizeof(afs_int32));
*aoutSize = sizeof(afs_int32);
if (pcheck->tinterval > 0) {
if (!afs_osi_suser(*acred))
return EACCES;
- PROBE_INTERVAL = pcheck->tinterval;
+ afs_probe_interval = pcheck->tinterval;
}
return 0;
}