Windows: AFSExamineVolume drop TreeLock if waiters
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 13 Apr 2013 05:57:56 +0000 (01:57 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 26 Apr 2013 13:24:04 +0000 (06:24 -0700)
After each call to AFSExamineObject drop the ObjectInfoTree.TreeLock
if there are threads waiting for access.  The garbage collection process
should not delay real work.

Change-Id: I2bd009d71b534d92d7e1b321b6db2204643e4666
Reviewed-on: http://gerrit.openafs.org/9786
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

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

index 32b2bd9..228cbc6 100644 (file)
@@ -1636,6 +1636,15 @@ AFSExamineVolume( IN AFSVolumeCB *pVolumeCB)
 
             AFSExamineObjectInfo( pCurrentObject, bVolumeObject, &bReleaseVolumeTreeLock);
 
+            if ( bReleaseVolumeTreeLock == TRUE &&
+                 ( ExGetExclusiveWaiterCount( pVolumeCB->ObjectInfoTree.TreeLock) > 0 ||
+                   ExGetSharedWaiterCount( pVolumeCB->ObjectInfoTree.TreeLock) > 0))
+            {
+
+                AFSReleaseResource( pVolumeCB->ObjectInfoTree.TreeLock);
+
+                bReleaseVolumeTreeLock = FALSE;
+            }
             //
             // The CurrentObject is either destroyed or the reference count has been
             // dropped by AFSExamineObjectInfo().