]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-readonly-volume-callbacks-20071111
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 12 Nov 2007 03:24:59 +0000 (03:24 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 12 Nov 2007 03:24:59 +0000 (03:24 +0000)
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.

src/WINNT/afsd/cm_daemon.c
src/WINNT/afsd/cm_volume.c

index 5e47a7f3234c9e713e6fe376b31e0ed9f4e4bf11..0469c8db50d16643068f0ba7d11ffded18d321dd 100644 (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();
index e2d9d62ba744b0f221aa36bd393c6a0fc82eff7b..326b6ef7d3f149e98f126c096922f23e3d4d94ee 100644 (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;