Windows: Protect ObjectRefCnts with ObjectInfoLock
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 5 Oct 2012 15:36:45 +0000 (11:36 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 14:01:56 +0000 (07:01 -0700)
commiteaad522651a81f20eac4966a55a731e0e59e39dd
tree3681d9d0fd8ccc18bb8adfb111c0f5db508886b3
parentcecd99abd3837ef820d78fb15e450c8688b0f39b
Windows: Protect ObjectRefCnts with ObjectInfoLock

The ObjectInfoCB.ObjectReferenceCount is tested to determined
when it is safe to remove an FCB from the ObjectInfoCB.  The
value must not be permitted to change while a removal is performed.

Protect AFSRemoveFcb() calls with exclusive holds of the
ObjectInfoCB.NonPagedInfo->ObjectInfoLock.  New functions:

  AFSObjectInfoIncrement()
  AFSObjectInfoDecrement()

perform all increments and decrements while holding the
ObjectInfoLock in a Shared state.

Change-Id: If89b7668ef0a891d55b039d9516620b581c79e10
Reviewed-on: http://gerrit.openafs.org/8224
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSCleanup.cpp
src/WINNT/afsrdr/kernel/lib/AFSClose.cpp
src/WINNT/afsrdr/kernel/lib/AFSCommSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSFcbSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h
src/WINNT/afsrdr/kernel/lib/Include/AFSStructs.h