From: Jeffrey Altman Date: Fri, 19 Oct 2012 13:33:18 +0000 (-0400) Subject: Windows: Promote DELETED from DirEntry to ObjInfo X-Git-Tag: openafs-stable-1_8_0pre1~1888 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f869b6f8c11f859fad6e3649faf7e724e0bd1d6d;hp=89c200c5658b2605f446c393f904874d4c65a28c Windows: Promote DELETED from DirEntry to ObjInfo On deletion of the DirEntry in AFSDeleteDirEntry() set the AFS_OBJECT_FLAGS_DELETED flag on the ObjectInformation object if and only if the AFS_DIR_ENTRY_DELETED flag was set in the DirEntry. Setting the AFS_OBJECT_FLAGS_DELETED should not be conditional on the ObjectInformatION ReferenceCount being zero. Remove the test and set of AFS_OBJECT_FLAGS_DELETED from AFSClose() because that operation will already have been performed in the call to AFSDeleteDirEntry() if necessary. Change-Id: Ib52f89633e6a343b08d408ef24b067c8fae73e0f Reviewed-on: http://gerrit.openafs.org/8256 Reviewed-by: Derrick Brashear Reviewed-by: Rod Widdowson Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp b/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp index 486b5a9..1c73f1b 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSClose.cpp @@ -413,8 +413,6 @@ AFSClose( IN PDEVICE_OBJECT LibDeviceObject, ClearFlag( pObjectInfo->Flags, AFS_OBJECT_INSERTED_HASH_TREE); } - - SetFlag( pObjectInfo->Flags, AFS_OBJECT_FLAGS_DELETED); } AFSReleaseResource( &pObjectInfo->NonPagedInfo->ObjectInfoLock); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp index 09407fe..f637ef4 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp @@ -2467,17 +2467,18 @@ AFSDeleteDirEntry( IN AFSObjectInfoCB *ParentObjectInfo, lCount = AFSObjectInfoDecrement( DirEntry->ObjectInformation); - if( lCount <= 0) - { - SetFlag( DirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED); - } - AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, AFS_TRACE_LEVEL_VERBOSE, "AFSDeleteDirEntry Decrement count on object %08lX Cnt %d\n", DirEntry->ObjectInformation, lCount); + if( BooleanFlagOn( DirEntry->Flags, AFS_DIR_ENTRY_DELETED)) + { + + SetFlag( DirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED); + } + ExDeleteResourceLite( &DirEntry->NonPaged->Lock); AFSExFreePoolWithTag( DirEntry->NonPaged, AFS_DIR_ENTRY_NP_TAG);