windows: ObjectInformationCB.ObjectReferenceCount
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSGeneric.cpp
index 4bd9ea6..fbdfa31 100644 (file)
@@ -1958,6 +1958,9 @@ AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB)
             try_return( ntStatus);
         }
 
+        AFSAcquireShared( pVolumeCB->ObjectInfoTree.TreeLock,
+                          TRUE);
+
         if ( AFSIsVolumeFID( &InvalidateCB->FileID))
         {
 
@@ -1966,9 +1969,6 @@ AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB)
         else
         {
 
-            AFSAcquireShared( pVolumeCB->ObjectInfoTree.TreeLock,
-                              TRUE);
-
             lCount = InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
 
             AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
@@ -1982,9 +1982,6 @@ AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB)
             ntStatus = AFSLocateHashEntry( pVolumeCB->ObjectInfoTree.TreeHead,
                                            ullIndex,
                                            (AFSBTreeEntry **)&pObjectInfo);
-
-            AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);
-
         }
 
         if( pObjectInfo != NULL)
@@ -2003,6 +2000,8 @@ AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB)
                           lCount);
         }
 
+        AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);
+
         if( !NT_SUCCESS( ntStatus) ||
             pObjectInfo == NULL)
         {