windows-readonly-volume-callbacks-20071111

disable the option by default.  require the daemonCheckVolCBInterval
registry value be set in order to activate it.

do not renew .readonly volumes whose callbacks are less than 30 minutes
old.
This commit is contained in:
Jeffrey Altman 2007-11-12 03:24:59 +00:00
parent e61efde323
commit f2bff0e675
2 changed files with 10 additions and 6 deletions

View File

@ -30,7 +30,7 @@ long cm_daemonCheckDownInterval = 180;
long cm_daemonCheckUpInterval = 240;
long cm_daemonCheckVolInterval = 3600;
long cm_daemonCheckCBInterval = 60;
long cm_daemonCheckVolCBInterval = 1800;
long cm_daemonCheckVolCBInterval = 0;
long cm_daemonCheckLockInterval = 60;
long cm_daemonTokenCheckInterval = 180;
long cm_daemonCheckOfflineVolInterval = 600;
@ -347,7 +347,8 @@ void cm_Daemon(long parm)
now = osi_Time();
lastVolCheck = now - cm_daemonCheckVolInterval/2 + (rand() % cm_daemonCheckVolInterval);
lastCBExpirationCheck = now - cm_daemonCheckCBInterval/2 + (rand() % cm_daemonCheckCBInterval);
lastVolCBRenewalCheck = now - cm_daemonCheckVolCBInterval/2 + (rand() % cm_daemonCheckVolCBInterval);
if (cm_daemonCheckVolCBInterval)
lastVolCBRenewalCheck = now - cm_daemonCheckVolCBInterval/2 + (rand() % cm_daemonCheckVolCBInterval);
lastLockCheck = now - cm_daemonCheckLockInterval/2 + (rand() % cm_daemonCheckLockInterval);
lastDownServerCheck = now - cm_daemonCheckDownInterval/2 + (rand() % cm_daemonCheckDownInterval);
lastUpServerCheck = now - cm_daemonCheckUpInterval/2 + (rand() % cm_daemonCheckUpInterval);
@ -406,7 +407,8 @@ void cm_Daemon(long parm)
now = osi_Time();
}
if (now > lastVolCBRenewalCheck + cm_daemonCheckVolCBInterval) {
if (cm_daemonCheckVolCBInterval &&
now > lastVolCBRenewalCheck + cm_daemonCheckVolCBInterval) {
lastVolCBRenewalCheck = now;
cm_VolumeRenewROCallbacks();
now = osi_Time();

View File

@ -1496,16 +1496,18 @@ enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID)
}
}
/* Renew .readonly volume callbacks that are more than
* 30 minutes old. (A volume callback is issued for 2 hours.)
*/
void
cm_VolumeRenewROCallbacks(void)
{
cm_volume_t * volp;
time_t minexp = time(NULL) + 90 * 60;
lock_ObtainRead(&cm_volumeLock);
for (volp = cm_data.allVolumesp; volp; volp=volp->allNextp) {
if ( volp->cbExpiresRO > 0) {
if ( volp->cbExpiresRO > 0 && volp->cbExpiresRO < minexp) {
cm_req_t req;
cm_fid_t fid;
cm_scache_t * scp;