ulCRC,
&pDirNode);
- AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
-
if( pDirNode != NULL)
{
"AFSNotifyFileCreate Located dir entry for file %wZ\n",
FileName);
+ InterlockedIncrement( &pDirNode->OpenReferenceCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSNotifyFileCreate Increment count on %wZ DE %p Cnt %d\n",
+ &pDirNode->NameInformation.FileName,
+ pDirNode,
+ pDirNode->OpenReferenceCount);
+
*DirNode = pDirNode;
+ AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
try_return( ntStatus = STATUS_REPARSE);
}
+ AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
//
// We are unsure of our current data so set the verify flag. It may already be set
// but no big deal to reset it
&pParentDirectoryCB->NameInformation.FileName,
ntStatus);
}
- else
- {
-
- //
- // Reference the new dir entry
- //
-
- InterlockedIncrement( &pCcb->DirectoryCB->OpenReferenceCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCreate Increment (Create) count on %wZ DE %p Ccb %p Cnt %d\n",
- &pCcb->DirectoryCB->NameInformation.FileName,
- pCcb->DirectoryCB,
- pCcb,
- pCcb->DirectoryCB->OpenReferenceCount);
- }
//
// Dereference the parent entry
SetFlag( pDirEntry->Flags, AFS_DIR_ENTRY_DELETED);
+ //
+ // Decrement the reference added during initialization of the DE
+ //
+
+ InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSProcessCreate Decrement count on %wZ DE %p Cnt %d\n",
+ &pDirEntry->NameInformation.FileName,
+ pDirEntry,
+ pDirEntry->OpenReferenceCount);
+
//
// Pull the directory entry from the parent
//
AFSDeleteDirEntry( ParentObjectInfo,
pDirNode);
+ InterlockedIncrement( &pExistingDirNode->OpenReferenceCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCreateDirEntry Increment count on %wZ DE %p Cnt %d\n",
+ &pExistingDirNode->NameInformation.FileName,
+ pExistingDirNode,
+ pExistingDirNode->OpenReferenceCount);
+
*DirEntry = pExistingDirNode;
AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
pDirNode,
TRUE);
+ InterlockedIncrement( &pDirNode->OpenReferenceCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCreateDirEntry Increment2 count on %wZ DE %p Cnt %d\n",
+ &pDirNode->NameInformation.FileName,
+ pDirNode,
+ pDirNode->OpenReferenceCount);
+
//
// Pass back the dir entry
//