]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-afsd-misc-20070706
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 7 Jul 2007 00:20:38 +0000 (00:20 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 7 Jul 2007 00:20:38 +0000 (00:20 +0000)
* Do not give back callbacks to down servers

* Output more cm_scache_t data in afsd_alloc.log

* call VolStatus_Service_Stopped after the service has stopped

src/WINNT/afsd/afsd_service.c
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_volstat.h

index 6180a891ca66910f220e782b4144b923d0ffec3b..745f4499e127fa68e13e8863697705c8f5a6f548 100644 (file)
@@ -1408,9 +1408,6 @@ afsd_Main(DWORD argc, LPTSTR *argv)
     else
        LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SERVICE_STOPPING);
 
-    /* Notify any Volume Status Handlers that we are stopping */
-    cm_VolStatus_Service_Stopped();
-
     /* allow an exit to be called prior to stopping the service */
     hHookDll = LoadLibrary(AFSD_HOOK_DLL);
     if (hHookDll)
@@ -1478,6 +1475,9 @@ afsd_Main(DWORD argc, LPTSTR *argv)
         PowerNotificationThreadExit();
 #endif
 
+    /* Notify any Volume Status Handlers that we are stopped */
+    cm_VolStatus_Service_Stopped();
+
     /* Cleanup any Volume Status Notification Handler */
     cm_VolStatus_Finalize();
 
index 9863ad1f90daf45a55fe4a2fd6a003d29ff1bfa0..6228a8d6e2c565491418fbc9844ce01b0a174b89 100644 (file)
@@ -1792,7 +1792,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp)
     cm_conn_t *connp;
     struct rx_connection * rxconnp;
 
-    if (tsp->type == CM_SERVER_FILE) {
+    if (tsp->type == CM_SERVER_FILE && !(tsp->flags & CM_SERVERFLAG_DOWN)) {
         code = cm_ConnByServer(tsp, cm_rootUserp, &connp);
         if (code == 0) {
             rxconnp = cm_GetRxConn(connp);
index c1163699fb5e83eed2230a2daf846050c1956bc4..5f6937fc9da91aef16fa39ee7c62fddd7335e6de 100644 (file)
@@ -1615,38 +1615,40 @@ int cm_DumpSCache(FILE *outputFile, char *cookie, int lock)
 {
     int zilch;
     cm_scache_t *scp;
-    char output[1024];
+    char output[2048];
     int i;
   
     if (lock)
         lock_ObtainRead(&cm_scacheLock);
   
-    sprintf(output, "%s - dumping scache - cm_data.currentSCaches=%d, cm_data.maxSCaches=%d\r\n", cookie, cm_data.currentSCaches, cm_data.maxSCaches);
+    sprintf(output, "%s - dumping all scache - cm_data.currentSCaches=%d, cm_data.maxSCaches=%d\r\n", cookie, cm_data.currentSCaches, cm_data.maxSCaches);
     WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
   
     for (scp = cm_data.allSCachesp; scp; scp = scp->allNextp) 
     {
-        sprintf(output, "%s scp=0x%p, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p flags=0x%x refCount=%u\r\n", 
+        sprintf(output, "%s scp=0x%p, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p type=%d dv=%d len=0x%I64x mp='%s' flags=0x%x cb=0x%x refCount=%u\r\n", 
                 cookie, scp, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique, 
-                scp->volp, scp->flags, scp->refCount);
+                scp->volp, scp->fileType, scp->dataVersion, scp->length.QuadPart, scp->mountPointStringp, scp->flags,
+                (unsigned long)scp->cbExpires, scp->refCount);
         WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
     }
   
-    sprintf(output, "%s - dumping cm_data.hashTable - cm_data.scacheHashTableSize=%d\r\n", cookie, cm_data.scacheHashTableSize);
+    sprintf(output, "%s - Done dumping all scache.\r\n", cookie);
+    WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
+    sprintf(output, "%s - dumping cm_data.scacheHashTable - cm_data.scacheHashTableSize=%d\r\n", cookie, cm_data.scacheHashTableSize);
     WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
   
     for (i = 0; i < cm_data.scacheHashTableSize; i++)
     {
         for(scp = cm_data.scacheHashTablep[i]; scp; scp=scp->nextp) 
         {
-            sprintf(output, "%s scp=0x%p, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d) volp=0x%p flags=0x%x refCount=%u\r\n", 
-                    cookie, scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, 
-                    scp->fid.unique, scp->volp, scp->flags, scp->refCount);
+            sprintf(output, "%s scp=0x%p, hash=%d, fid (cell=%d, volume=%d, vnode=%d, unique=%d)\r\n", 
+                    cookie, scp, i, scp->fid.cell, scp->fid.volume, scp->fid.vnode, scp->fid.unique);
             WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
         }
     }
 
-    sprintf(output, "%s - Done dumping scache.\r\n", cookie);
+    sprintf(output, "%s - Done dumping cm_data.scacheHashTable\r\n", cookie);
     WriteFile(outputFile, output, (DWORD)strlen(output), &zilch, NULL);
   
     if (lock)
index 834c0898ce8ee4cdf2fe5c1616bb5403aeed7917..69b30adaed4c8678ad9d3966e60b3b2533a345e7 100644 (file)
@@ -15,7 +15,7 @@ extern long cm_VolStatus_Finalize(void);
 
 extern long cm_VolStatus_Service_Started(void);
 
-extern long cm_VolStatus_Service_Stopping(void);
+extern long cm_VolStatus_Service_Stopped(void);
 
 #ifdef _WIN64
 extern long cm_VolStatus_Network_Started(const char * netbios32, const char * netbios64);