From 27768ade8578ced4485b1601e26bff53d5450f50 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 30 Oct 2013 23:33:40 -0500 Subject: [PATCH 1/1] volserver: Remove -sleep functionality 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 Tested-by: BuildBot --- doc/man-pages/pod8/fragments/volserver-options.pod | 14 ++---- src/volser/volmain.c | 56 +--------------------- 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/doc/man-pages/pod8/fragments/volserver-options.pod b/doc/man-pages/pod8/fragments/volserver-options.pod index acdfc89..a3ddf78 100644 --- a/doc/man-pages/pod8/fragments/volserver-options.pod +++ b/doc/man-pages/pod8/fragments/volserver-options.pod @@ -118,17 +118,9 @@ the log message should be sent. =item B<-sleep> /I> -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 seconds, the volserver is -forced to sleep for I 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> diff --git a/src/volser/volmain.c b/src/volser/volmain.c index 05e358c..6c6ad53 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -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); -- 1.9.4