Windows: additional AFS_SUBSYSTEM_OBJECT_REF_COUNTING
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 28 Mar 2013 04:28:35 +0000 (00:28 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 31 Mar 2013 00:33:25 +0000 (17:33 -0700)
Add missing cases of reference count value changes which were
not being logged.

Change-Id: I8bc26f31f2725e2c324831bce3da0b68a7fb91d9
Reviewed-on: http://gerrit.openafs.org/9690
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp

index 1854c0c..5a9c833 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
- * Copyright (c) 2009, 2010, 2011 Your File System, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * - Redistributions of source code must retain the above copyright notice,
  *   this list of conditions and the following disclaimer.
  * - Redistributions in binary form must reproduce the above copyright
- *   notice,
- *   this list of conditions and the following disclaimer in the
- *   documentation
- *   and/or other materials provided with the distribution.
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
  * - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
  *   nor the names of their contributors may be used to endorse or promote
  *   products derived from this software without specific prior written
@@ -6777,6 +6775,7 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB,
     DWORD            ntStatus = STATUS_SUCCESS;
     ULONGLONG        ullIndex;
     AFSObjectInfoCB *pObjectInfo = NULL;
+    LONG             lCount;
 
     if ( AFSIsEqualFID( &VolumeCB->ObjectInformation.FileId, FileId))
     {
@@ -6800,8 +6799,14 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB,
 
     if ( NT_SUCCESS( ntStatus)) {
 
-        AFSObjectInfoIncrement( pObjectInfo,
-                                AFS_OBJECT_REFERENCE_FIND);
+        lCount = AFSObjectInfoIncrement( pObjectInfo,
+                                         AFS_OBJECT_REFERENCE_FIND);
+
+        AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                      AFS_TRACE_LEVEL_VERBOSE,
+                      "AFSFindObjectInfo Decrement count on object %p Cnt %d\n",
+                      pObjectInfo,
+                      lCount));
     }
 
     return pObjectInfo;
@@ -6810,9 +6815,16 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB,
 void
 AFSReleaseObjectInfo( IN AFSObjectInfoCB **ppObjectInfo)
 {
+    LONG lCount;
 
-    AFSObjectInfoDecrement( *ppObjectInfo,
-                            AFS_OBJECT_REFERENCE_FIND);
+    lCount = AFSObjectInfoDecrement( *ppObjectInfo,
+                                     AFS_OBJECT_REFERENCE_FIND);
+
+    AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                  AFS_TRACE_LEVEL_VERBOSE,
+                  "AFSReleaseObjectInfo Decrement count on object %p Cnt %d\n",
+                  *ppObjectInfo,
+                  lCount));
 
     *ppObjectInfo = NULL;
 }
@@ -8364,6 +8376,12 @@ AFSCloseLibrary()
             lCount = AFSObjectInfoDecrement( AFSGlobalDotDirEntry->ObjectInformation,
                                              AFS_OBJECT_REFERENCE_GLOBAL);
 
+            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                          AFS_TRACE_LEVEL_VERBOSE,
+                          "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n",
+                          AFSGlobalDotDirEntry->ObjectInformation,
+                          lCount));
+
             AFSDeleteObjectInfo( &AFSGlobalDotDirEntry->ObjectInformation);
 
             ExDeleteResourceLite( &AFSGlobalDotDirEntry->NonPaged->Lock);
@@ -8381,6 +8399,12 @@ AFSCloseLibrary()
             lCount = AFSObjectInfoDecrement( AFSGlobalDotDotDirEntry->ObjectInformation,
                                              AFS_OBJECT_REFERENCE_GLOBAL);
 
+            AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                          AFS_TRACE_LEVEL_VERBOSE,
+                          "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n",
+                          AFSGlobalDotDotDirEntry->ObjectInformation,
+                          lCount));
+
             AFSDeleteObjectInfo( &AFSGlobalDotDotDirEntry->ObjectInformation);
 
             ExDeleteResourceLite( &AFSGlobalDotDotDirEntry->NonPaged->Lock);
@@ -8405,6 +8429,12 @@ AFSCloseLibrary()
                 lCount = AFSObjectInfoDecrement( pDirNode->ObjectInformation,
                                                  AFS_OBJECT_REFERENCE_GLOBAL);
 
+                AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
+                              AFS_TRACE_LEVEL_VERBOSE,
+                              "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n",
+                              pDirNode->ObjectInformation,
+                              lCount));
+
                 AFSDeleteObjectInfo( &pDirNode->ObjectInformation);
 
                 ExDeleteResourceLite( &pDirNode->NonPaged->Lock);
index 478f987..32cab20 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
- * Copyright (c) 2009, 2010, 2011 Your File System, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * - Redistributions of source code must retain the above copyright notice,
  *   this list of conditions and the following disclaimer.
  * - Redistributions in binary form must reproduce the above copyright
- *   notice,
- *   this list of conditions and the following disclaimer in the
- *   documentation
- *   and/or other materials provided with the distribution.
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
  * - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
  *   nor the names of their contributors may be used to endorse or promote
  *   products derived from this software without specific prior written
@@ -1065,7 +1063,7 @@ AFSExamineDirectory( IN AFSObjectInfoCB * pCurrentObject,
 
             AFSReleaseResource( &pCurrentChildObject->NonPagedInfo->ObjectInfoLock);
 
-            AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
+            AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING | AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSExamineDirectory Deleting object %p\n",
                           pCurrentChildObject));