volserver: Remove -sleep functionality
authorAndrew Deason <adeason@sinenomine.net>
Thu, 31 Oct 2013 04:33:40 +0000 (23:33 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Thu, 7 Nov 2013 12:19:39 +0000 (04:19 -0800)
This option is completely useless since the LWP volserver was removed.
Remove the code for it.

Change-Id: I2257ba2ecd2ffeb9c47d21cbb516d6a0abb19b94
Reviewed-on: http://gerrit.openafs.org/10424
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

doc/man-pages/pod8/fragments/volserver-options.pod
src/volser/volmain.c

index acdfc89..a3ddf78 100644 (file)
@@ -118,17 +118,9 @@ the log message should be sent.
 
 =item B<-sleep> <I<sleep_time>/I<run_time>>
 
-This option only applies to the LWP version of the volserver, and has no effect
-on the pthreaded version of the volserver. Note that OpenAFS no longer ships an
-LWP version of the volserver; the last version series where the LWP volserver
-was even built was the 1.6.x series of OpenAFS.
-
-For the LWP version of the volserver, specifying this option forces the
-volserver to sleep during certain volume operations, so the volserver does not
-become I/O bound. Approximately every I<run_time> seconds, the volserver is
-forced to sleep for I<sleep_time> seconds if any volume transactions are active
-that are performing certain operations. This includes operations involving
-deleting, cloning, moving, releasing, copying, or restoring a volume.
+This option is obsolete, and is now only accepted for compatibility with older
+releases. All it does now is log a warning message about how the option is
+obsolete.
 
 =item B<-help>
 
index 05e358c..6c6ad53 100644 (file)
@@ -154,46 +154,6 @@ BKGLoop(void *unused)
     return NULL;
 }
 
-/* Background daemon for sleeping so the volserver does not become I/O bound */
-afs_int32 TTsleep, TTrun;
-#ifndef AFS_PTHREAD_ENV
-static void *
-BKGSleep(void *unused)
-{
-    struct volser_trans *tt;
-
-    if (TTsleep) {
-       while (1) {
-#ifdef AFS_PTHREAD_ENV
-           sleep(TTrun);
-#else /* AFS_PTHREAD_ENV */
-           IOMGR_Sleep(TTrun);
-#endif
-           VTRANS_LOCK;
-           for (tt = TransList(); tt; tt = tt->next) {
-                VTRANS_OBJ_LOCK(tt);
-               if ((strcmp(tt->lastProcName, "DeleteVolume") == 0)
-                   || (strcmp(tt->lastProcName, "Clone") == 0)
-                   || (strcmp(tt->lastProcName, "ReClone") == 0)
-                   || (strcmp(tt->lastProcName, "Forward") == 0)
-                   || (strcmp(tt->lastProcName, "Restore") == 0)
-                   || (strcmp(tt->lastProcName, "ForwardMulti") == 0)) {
-                    VTRANS_OBJ_UNLOCK(tt);
-                   break;
-                }
-                VTRANS_OBJ_UNLOCK(tt);
-           }
-           if (tt) {
-               VTRANS_UNLOCK;
-               sleep(TTsleep);
-           } else
-               VTRANS_UNLOCK;
-       }
-    }
-    return NULL;
-}
-#endif
-
 #ifdef AFS_NT40_ENV
 /* no volser_syscall */
 #elif defined(AFS_SUN511_ENV)
@@ -380,13 +340,7 @@ ParseArgs(int argc, char **argv) {
        }
     }
     if (cmd_OptionAsString(opts, OPT_sleep, &sleepSpec) == 0) {
-       sscanf(sleepSpec, "%d/%d", &TTsleep, &TTrun);
-       if ((TTsleep < 0) || (TTrun <= 0)) {
-           printf("Warning: '-sleep %d/%d' is incorrect; ignoring\n",
-                   TTsleep, TTrun);
-           TTsleep = TTrun = 0;
-       }
-
+       printf("Warning: -sleep option ignored; this option is obsolete\n");
     }
     if (cmd_OptionAsString(opts, OPT_sync, &sync_behavior) == 0) {
        if (ih_SetSyncBehavior(sync_behavior)) {
@@ -440,8 +394,6 @@ main(int argc, char **argv)
        exit(2);
     }
 
-    TTsleep = TTrun = 0;
-
     configDir = strdup(AFSDIR_SERVER_ETC_DIRPATH);
     logFile = strdup(AFSDIR_SERVER_VOLSERLOG_FILEPATH);
 
@@ -544,7 +496,6 @@ main(int argc, char **argv)
 #else
        PROCESS pid;
        LWP_CreateProcess(BKGLoop, 16*1024, 3, 0, "vol bkg daemon", &pid);
-       LWP_CreateProcess(BKGSleep,16*1024, 3, 0, "vol slp daemon", &pid);
 #endif
     }
 
@@ -600,11 +551,6 @@ main(int argc, char **argv)
     if (afsconf_GetLatestKey(tdir, NULL, NULL) == 0) {
        LogDesWarning();
     }
-    if (TTsleep) {
-       Log("Will sleep %d second%s every %d second%s\n", TTsleep,
-           (TTsleep > 1) ? "s" : "", TTrun + TTsleep,
-           (TTrun + TTsleep > 1) ? "s" : "");
-    }
 
     /* allow super users to manage RX statistics */
     rx_SetRxStatUserOk(vol_rxstat_userok);