Windows: Promote DELETED from DirEntry to ObjInfo
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 13:33:18 +0000 (09:33 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 28 Oct 2012 01:44:38 +0000 (18:44 -0700)
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 <shadow@your-file-system.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSClose.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp

index 486b5a9..1c73f1b 100644 (file)
@@ -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);
index 09407fe..f637ef4 100644 (file)
@@ -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);