]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libafs: stop bkg first
authorDerrick Brashear <shadow@dementix.org>
Wed, 18 Apr 2012 15:58:52 +0000 (11:58 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 28 May 2012 14:38:48 +0000 (07:38 -0700)
because background daemons can have dependence on other subsystems, but
are not needed for other operations, stop them first.

Reviewed-on: http://gerrit.openafs.org/7246
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e3c93b87b7fa751e9cf4c1356d606b7bb399b06c)

Change-Id: I258519a2ad85af53784cf4db381a7f4a8b429dc8
Reviewed-on: http://gerrit.openafs.org/7485
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/afs_call.c
src/afs/afs_cell.c
src/afs/afs_daemons.c

index 0841090e9b6e1605c4f0e3b7ab7b6510cfae9353..f384ec3f05ef6fec1f1bebd0d33c25a318c4a23a 100644 (file)
@@ -66,7 +66,9 @@ static int AFS_Running = 0;
 static int afs_CacheInit_Done = 0;
 static int afs_Go_Done = 0;
 extern struct interfaceAddr afs_cb_interface;
+#ifdef RXK_LISTENER_ENV
 static int afs_RX_Running = 0;
+#endif
 static int afs_InitSetup_done = 0;
 afs_int32 afs_numcachefiles = -1;
 afs_int32 afs_numfilesperdir = -1;
@@ -1373,6 +1375,15 @@ afs_shutdown(void)
     afs_FlushAllVCaches();
 #endif
 
+    afs_termState = AFSOP_STOP_BKG;
+
+    afs_warn("BkG... ");
+    /* Wake-up afs_brsDaemons so that we don't have to wait for a bkg job! */
+    while (afs_termState == AFSOP_STOP_BKG) {
+       afs_osi_Wakeup(&afs_brsDaemons);
+       afs_osi_Sleep(&afs_termState);
+    }
+
     afs_warn("CB... ");
 
     afs_termState = AFSOP_STOP_RXCALLBACK;
@@ -1395,12 +1406,6 @@ afs_shutdown(void)
            afs_osi_Sleep(&afs_termState);
        }
     }
-    afs_warn("BkG... ");
-    /* Wake-up afs_brsDaemons so that we don't have to wait for a bkg job! */
-    while (afs_termState == AFSOP_STOP_BKG) {
-       afs_osi_Wakeup(&afs_brsDaemons);
-       afs_osi_Sleep(&afs_termState);
-    }
     afs_warn("CTrunc... ");
     /* Cancel cache truncate daemon. */
     while (afs_termState == AFSOP_STOP_TRUNCDAEMON) {
index f68868992a2e310eb24041c084ac7b16e4d39d76..5444cf42fa4020033a396c5c84a2ab28fa454e3e 100644 (file)
@@ -57,7 +57,11 @@ afs_StopAFSDB(void)
        afs_osi_Wakeup(&afsdb_req);
     } else {
        afsdb_handler_shutdown = 1;
+#if defined(AFS_SUN5_ENV) || defined(RXK_LISTENER_ENV) || defined(RXK_UPCALL_ENV)
        afs_termState = AFSOP_STOP_RXEVENT;
+#else
+       afs_termState = AFSOP_STOP_COMPLETE;
+#endif
        afs_osi_Wakeup(&afs_termState);
     }
 }
index 23655e3f0f7cac8eb5061e58c2cc92075540df26..36140b330a408c0c6ce3bb32cee7b19a76551ab4 100644 (file)
@@ -90,7 +90,7 @@ afs_CheckServerDaemon(void)
     last10MinCheck = lastCheck = osi_Time();
     while (1) {
        if (afs_termState == AFSOP_STOP_CS) {
-           afs_termState = AFSOP_STOP_BKG;
+           afs_termState = AFSOP_STOP_TRUNCDAEMON;
            afs_osi_Wakeup(&afs_termState);
            break;
        }
@@ -108,7 +108,7 @@ afs_CheckServerDaemon(void)
        }
        /* shutdown check. */
        if (afs_termState == AFSOP_STOP_CS) {
-           afs_termState = AFSOP_STOP_BKG;
+           afs_termState = AFSOP_STOP_TRUNCDAEMON;
            afs_osi_Wakeup(&afs_termState);
            break;
        }
@@ -308,7 +308,7 @@ afs_Daemon(void)
            if (afs_CheckServerDaemonStarted)
                afs_termState = AFSOP_STOP_CS;
            else
-               afs_termState = AFSOP_STOP_BKG;
+               afs_termState = AFSOP_STOP_TRUNCDAEMON;
            afs_osi_Wakeup(&afs_termState);
            return;
        }
@@ -1045,7 +1045,7 @@ afs_BackgroundDaemon(void)
 
        if (afs_termState == AFSOP_STOP_BKG) {
            if (--afs_nbrs <= 0)
-               afs_termState = AFSOP_STOP_TRUNCDAEMON;
+               afs_termState = AFSOP_STOP_RXCALLBACK;
            ReleaseWriteLock(&afs_xbrs);
            afs_osi_Wakeup(&afs_termState);
 #ifdef AFS_DARWIN80_ENV