ASSERT( pFcb->OpenHandleCount != 0);
- InterlockedDecrement( &pFcb->OpenHandleCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCleanup (IOCtl) Decrement handle count on Fcb %08lX Cnt %d\n",
- pFcb,
- pFcb->OpenHandleCount);
-
//
// Decrement the open child handle count
//
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
}
+ InterlockedDecrement( &pFcb->OpenHandleCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCleanup (IOCtl) Decrement handle count on Fcb %08lX Cnt %d\n",
+ pFcb,
+ pFcb->OpenHandleCount);
+
//
// And finally, release the Fcb if we acquired it.
//
ASSERT( pFcb->OpenHandleCount != 0);
- InterlockedDecrement( &pFcb->OpenHandleCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCleanup (File) Decrement handle count on Fcb %08lX Cnt %d\n",
- pFcb,
- pFcb->OpenHandleCount);
-
if( pFcb->ObjectInformation->ParentObjectInformation != NULL)
{
}
//
- // If the count has dropped to zero and there is a pending delete
- // then delete the node
+ // If the count has dropped to one and there is a pending delete
+ // then delete the node. The final count will be decremented just
+ // before the Fcb->NPFcb->Resource is released.
//
- if( pFcb->OpenHandleCount == 0 &&
+ if( pFcb->OpenHandleCount == 1 &&
BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE))
{
&pCcb->AuthGroup);
}
- if( pFcb->OpenHandleCount == 0)
+ if( pFcb->OpenHandleCount == 1)
{
//
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
}
+ InterlockedDecrement( &pFcb->OpenHandleCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCleanup (File) Decrement handle count on Fcb %08lX Cnt %d\n",
+ pFcb,
+ pFcb->OpenHandleCount);
+
//
// And finally, release the Fcb if we acquired it.
//
ASSERT( pFcb->OpenHandleCount != 0);
- InterlockedDecrement( &pFcb->OpenHandleCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCleanup (Dir) Decrement handle count on Fcb %08lX Cnt %d\n",
- pFcb,
- pFcb->OpenHandleCount);
-
if( pFcb->ObjectInformation->ParentObjectInformation != NULL)
{
}
//
- // If the count has dropped to zero and there is a pending delete
- // then delete the node
+ // If the count has dropped to one and there is a pending delete
+ // then delete the node. The final count will be decremented just
+ // before the Fcb->NPFcb->Resource is released.
//
- if( pFcb->OpenHandleCount == 0 &&
+ if( pFcb->OpenHandleCount == 1 &&
BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE))
{
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
}
+ InterlockedDecrement( &pFcb->OpenHandleCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCleanup (Dir) Decrement handle count on Fcb %08lX Cnt %d\n",
+ pFcb,
+ pFcb->OpenHandleCount);
+
//
// And finally, release the Fcb if we acquired it.
//
ASSERT( pFcb->OpenHandleCount != 0);
- InterlockedDecrement( &pFcb->OpenHandleCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCleanup (MP/SL) Decrement handle count on Fcb %08lX Cnt %d\n",
- pFcb,
- pFcb->OpenHandleCount);
-
if( pFcb->ObjectInformation->ParentObjectInformation != NULL)
{
}
//
- // If the count has dropped to zero and there is a pending delete
- // then delete the node
+ // If the count has dropped to one and there is a pending delete
+ // then delete the node. The final count will be decremented just
+ // before the Fcb->NPFcb->Resource is released.
//
- if( pFcb->OpenHandleCount == 0 &&
+ if( pFcb->OpenHandleCount == 1 &&
BooleanFlagOn( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE))
{
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
}
+ InterlockedDecrement( &pFcb->OpenHandleCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCleanup (Share) Decrement handle count on Fcb %08lX Cnt %d\n",
+ pFcb,
+ pFcb->OpenHandleCount);
+
//
// And finally, release the Fcb if we acquired it.
//
ASSERT( pFcb->OpenHandleCount != 0);
- InterlockedDecrement( &pFcb->OpenHandleCount);
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCleanup (Share) Decrement handle count on Fcb %08lX Cnt %d\n",
- pFcb,
- pFcb->OpenHandleCount);
-
//
// Decrement the open child handle count
//
pObjectInfo->ParentObjectInformation->Specific.Directory.ChildOpenHandleCount);
}
+ InterlockedDecrement( &pFcb->OpenHandleCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FCB_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCleanup (MP/SL) Decrement handle count on Fcb %08lX Cnt %d\n",
+ pFcb,
+ pFcb->OpenHandleCount);
+
//
// And finally, release the Fcb if we acquired it.
//