From 5952cc139c102035591e8c95bbba313cf709d332 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 13 Apr 2013 01:57:56 -0400 Subject: [PATCH] Windows: AFSExamineVolume drop TreeLock if waiters 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 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp index 32b2bd9160..228cbc671c 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp @@ -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().