SetFlag( pFcb->Flags, AFS_FCB_FILE_CLOSED);
- //
- // Attempt to tear down our extent list for the file
- // If there are remaining dirty extents then attempt to
- // flush them as well
- //
+ if( !BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- if( pFcb->Specific.File.ExtentsDirtyCount)
- {
+ //
+ // Attempt to tear down our extent list for the file
+ // If there are remaining dirty extents then attempt to
+ // flush them as well
+ //
- AFSFlushExtents( pFcb,
- &pCcb->AuthGroup);
- }
+ if( pFcb->Specific.File.ExtentsDirtyCount)
+ {
- //
- // Wait for any outstanding queued flushes to complete
- //
+ AFSFlushExtents( pFcb,
+ &pCcb->AuthGroup);
+ }
- AFSWaitOnQueuedFlushes( pFcb);
+ //
+ // Wait for any outstanding queued flushes to complete
+ //
- ASSERT( pFcb->Specific.File.ExtentsDirtyCount == 0 &&
- pFcb->Specific.File.QueuedFlushCount == 0);
+ AFSWaitOnQueuedFlushes( pFcb);
- AFSReleaseResource( &pFcb->NPFcb->Resource);
+ ASSERT( pFcb->Specific.File.ExtentsDirtyCount == 0 &&
+ pFcb->Specific.File.QueuedFlushCount == 0);
- //
- // Tear 'em down, we'll not be needing them again
- //
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
- AFSTearDownFcbExtents( pFcb,
- &pCcb->AuthGroup);
- }
- else
- {
+ //
+ // Tear 'em down, we'll not be needing them again
+ //
- if( pFcb->Header.NodeTypeCode == AFS_FILE_FCB &&
- pFcb->Specific.File.ExtentsDirtyCount &&
- (pCcb->GrantedAccess & FILE_WRITE_DATA))
- {
+ AFSTearDownFcbExtents( pFcb,
+ &pCcb->AuthGroup);
+ }
+ else
+ {
- AFSFlushExtents( pFcb,
- &pCcb->AuthGroup);
- }
+ if( pFcb->Header.NodeTypeCode == AFS_FILE_FCB &&
+ pFcb->Specific.File.ExtentsDirtyCount &&
+ (pCcb->GrantedAccess & FILE_WRITE_DATA))
+ {
- AFSReleaseResource( &pFcb->NPFcb->Resource);
- }
+ AFSFlushExtents( pFcb,
+ &pCcb->AuthGroup);
+ }
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+ }
+ }
+ else
+ {
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+ }
pDirCB = pCcb->DirectoryCB;
{
UNREFERENCED_PARAMETER(LibDeviceObject);
+ AFSDeviceExt *pRDRDevExt = (AFSDeviceExt *) AFSRDRDeviceObject->DeviceExtension;
NTSTATUS ntStatus = STATUS_SUCCESS;
IO_STACK_LOCATION *pIrpSp = IoGetCurrentIrpStackLocation( Irp);
PFILE_OBJECT pFileObject = pIrpSp->FileObject;
try_return( ntStatus = GetExceptionCode());
}
- AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING|AFS_SUBSYSTEM_SECTION_OBJECT,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSFlushBuffers Releasing Fcb SectionObject lock %p SHARED %08lX\n",
- &pFcb->NPFcb->SectionObjectResource,
- PsGetCurrentThread()));
+ if( !BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
+
+ AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING|AFS_SUBSYSTEM_SECTION_OBJECT,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSFlushBuffers Releasing Fcb SectionObject lock %p SHARED %08lX\n",
+ &pFcb->NPFcb->SectionObjectResource,
+ PsGetCurrentThread()));
- AFSReleaseResource( &pFcb->NPFcb->SectionObjectResource);
+ AFSReleaseResource( &pFcb->NPFcb->SectionObjectResource);
- bReleaseSectionObject = FALSE;
+ bReleaseSectionObject = FALSE;
- //
- // Now, flush to the server - if there is stuff to do
- //
+ //
+ // Now, flush to the server - if there is stuff to do
+ //
- ntStatus = AFSFlushExtents( pFcb,
- &pCcb->AuthGroup);
+ ntStatus = AFSFlushExtents( pFcb,
+ &pCcb->AuthGroup);
- if( !NT_SUCCESS( ntStatus))
- {
+ if( !NT_SUCCESS( ntStatus))
+ {
- AFSReleaseExtentsWithFlush( pFcb,
- &pCcb->AuthGroup,
- TRUE);
+ AFSReleaseExtentsWithFlush( pFcb,
+ &pCcb->AuthGroup,
+ TRUE);
- ntStatus = STATUS_SUCCESS;
- }
+ ntStatus = STATUS_SUCCESS;
+ }
+ }
try_exit:
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt *pRDRDevExt = (AFSDeviceExt *) AFSRDRDeviceObject->DeviceExtension;
IO_STATUS_BLOCK stIoStatus;
ULONG ulFilter = 0;
AFSObjectInfoCB * pParentObjectInfo = NULL;
AFSReleaseResource( &(*ppObjectInfo)->Fcb->NPFcb->Resource);
- //
- // Clear out the extents
- // Get rid of them (note this involves waiting
- // for any writes or reads to the cache to complete)
- //
+ if( !BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- AFSTearDownFcbExtents( (*ppObjectInfo)->Fcb,
- NULL);
+ //
+ // Clear out the extents
+ // Get rid of them (note this involves waiting
+ // for any writes or reads to the cache to complete)
+ //
+
+ AFSTearDownFcbExtents( (*ppObjectInfo)->Fcb,
+ NULL);
+ }
}
(*ppObjectInfo)->DataVersion.QuadPart = (ULONGLONG)-1;
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt *pRDRDevExt = (AFSDeviceExt *) AFSRDRDeviceObject->DeviceExtension;
AFSDirEnumEntry *pDirEnumEntry = NULL;
AFSObjectInfoCB *pObjectInfo = DirEntry->ObjectInformation;
IO_STATUS_BLOCK stIoStatus;
AFSReleaseResource( &pObjectInfo->Fcb->NPFcb->SectionObjectResource);
- AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSVerifyEntry Releasing Fcb lock %p EXCL %08lX\n",
- &pObjectInfo->Fcb->NPFcb->Resource,
- PsGetCurrentThread()));
+ if( !BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- AFSReleaseResource( &pObjectInfo->Fcb->NPFcb->Resource);
+ AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSVerifyEntry Releasing Fcb lock %p EXCL %08lX\n",
+ &pObjectInfo->Fcb->NPFcb->Resource,
+ PsGetCurrentThread()));
- AFSFlushExtents( pObjectInfo->Fcb,
- AuthGroup);
+ AFSReleaseResource( &pObjectInfo->Fcb->NPFcb->Resource);
- //
- // Acquire the Fcb to purge the cache
- //
+ AFSFlushExtents( pObjectInfo->Fcb,
+ AuthGroup);
- AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSVerifyEntry Acquiring Fcb lock %p EXCL %08lX\n",
- &pObjectInfo->Fcb->NPFcb->Resource,
- PsGetCurrentThread()));
+ //
+ // Acquire the Fcb to purge the cache
+ //
- AFSAcquireExcl( &pObjectInfo->Fcb->NPFcb->Resource,
- TRUE);
+ AFSDbgTrace(( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSVerifyEntry Acquiring Fcb lock %p EXCL %08lX\n",
+ &pObjectInfo->Fcb->NPFcb->Resource,
+ PsGetCurrentThread()));
+
+ AFSAcquireExcl( &pObjectInfo->Fcb->NPFcb->Resource,
+ TRUE);
+ }
//
// Update the metadata for the entry
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt *pRDRDevExt = (AFSDeviceExt *) AFSRDRDeviceObject->DeviceExtension;
LARGE_INTEGER liSystemTime;
AFSDirEnumEntry *pDirEnumEntry = NULL;
AFSFcb *pCurrentFcb = NULL;
if ( bPurgeExtents &&
bSafeToPurge)
{
- AFSFlushExtents( pCurrentFcb,
- AuthGroup);
+
+ if( !BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
+ AFSFlushExtents( pCurrentFcb,
+ AuthGroup);
+ }
}
}
AFSReleaseResource( &Fcb->NPFcb->Resource);
- //
- // Wait for any currently running flush or release requests to complete
- //
+ if( !BooleanFlagOn( pRDRDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
+ //
+ // Wait for any currently running flush or release requests to complete
+ //
- AFSWaitOnQueuedFlushes( Fcb);
+ AFSWaitOnQueuedFlushes( Fcb);
- //
- // Now perform another flush on the file
- //
+ //
+ // Now perform another flush on the file
+ //
- if( !NT_SUCCESS( AFSFlushExtents( Fcb,
- NULL)))
- {
+ if( !NT_SUCCESS( AFSFlushExtents( Fcb,
+ NULL)))
+ {
- AFSReleaseExtentsWithFlush( Fcb,
- NULL,
- TRUE);
- }
- }
+ AFSReleaseExtentsWithFlush( Fcb,
+ NULL,
+ TRUE);
+ }
+ }
+ }
- if( Fcb->OpenReferenceCount == 0 ||
- BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
- BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED))
- {
+ if( !BooleanFlagOn( pRDRDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- AFSTearDownFcbExtents( Fcb,
- NULL);
- }
+ if( Fcb->OpenReferenceCount == 0 ||
+ BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
+ BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED))
+ {
+
+ AFSTearDownFcbExtents( Fcb,
+ NULL);
+ }
+ }
try_return( ntStatus);
}
KeQueryTickCount( &liTime);
- //
- // First up are there dirty extents in the cache to flush?
- //
+ if( !BooleanFlagOn( pRDRDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
+ //
+ // First up are there dirty extents in the cache to flush?
+ //
- if( BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
- BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED))
- {
+ if( BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
+ BooleanFlagOn( Fcb->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED))
+ {
- //
- // The file has been marked as invalid. Dump it
- //
+ //
+ // The file has been marked as invalid. Dump it
+ //
- AFSTearDownFcbExtents( Fcb,
- NULL);
- }
- else if( ForceFlush ||
- ( ( Fcb->Specific.File.ExtentsDirtyCount ||
- Fcb->Specific.File.ExtentCount) &&
- (liTime.QuadPart - Fcb->Specific.File.LastServerFlush.QuadPart)
- >= pControlDeviceExt->Specific.Control.FcbFlushTimeCount.QuadPart))
- {
- if( !NT_SUCCESS( AFSFlushExtents( Fcb,
- NULL)) &&
- Fcb->OpenReferenceCount == 0)
- {
+ AFSTearDownFcbExtents( Fcb,
+ NULL);
+ }
+ else if( ForceFlush ||
+ ( ( Fcb->Specific.File.ExtentsDirtyCount ||
+ Fcb->Specific.File.ExtentCount) &&
+ (liTime.QuadPart - Fcb->Specific.File.LastServerFlush.QuadPart)
+ >= pControlDeviceExt->Specific.Control.FcbFlushTimeCount.QuadPart))
+ {
- AFSReleaseExtentsWithFlush( Fcb,
- NULL,
- TRUE);
- }
+ if( !NT_SUCCESS( AFSFlushExtents( Fcb,
+ NULL)) &&
+ Fcb->OpenReferenceCount == 0)
+ {
+
+ AFSReleaseExtentsWithFlush( Fcb,
+ NULL,
+ TRUE);
+ }
+ }
}
//
AFSReleaseResource( &Fcb->NPFcb->Resource);
- if( Fcb->OpenReferenceCount <= 0)
- {
+ if( !BooleanFlagOn( pRDRDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- //
- // Tear em down we'll not be needing them again
- //
+ if( Fcb->OpenReferenceCount <= 0)
+ {
- AFSTearDownFcbExtents( Fcb,
- NULL);
- }
+ //
+ // Tear em down we'll not be needing them again
+ //
+
+ AFSTearDownFcbExtents( Fcb,
+ NULL);
+ }
+ }
}
else
{
__Enter
{
- switch( InvalidateReason)
+ switch( InvalidateReason)
{
case AFS_INVALIDATE_DELETED:
{
- if( ObjectInfo->FileType == AFS_FILE_TYPE_FILE &&
+ AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSPerformObjectInvalidation on node type %d for FID %08lX-%08lX-%08lX-%08lX Reason DELETED\n",
+ ObjectInfo->FileType,
+ ObjectInfo->FileId.Cell,
+ ObjectInfo->FileId.Volume,
+ ObjectInfo->FileId.Vnode,
+ ObjectInfo->FileId.Unique));
+
+ if( ObjectInfo->FileType == AFS_FILE_TYPE_FILE &&
ObjectInfo->Fcb != NULL)
{
- AFSAcquireExcl( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource,
- TRUE);
+ if( !BooleanFlagOn( pRDRDevExt->DeviceFlags, AFS_DEVICE_FLAG_DIRECT_SERVICE_IO))
+ {
- ObjectInfo->Links = 0;
+ AFSAcquireExcl( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource,
+ TRUE);
- ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestStatus = STATUS_FILE_DELETED;
+ ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestStatus = STATUS_FILE_DELETED;
- KeSetEvent( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestComplete,
- 0,
- FALSE);
+ KeSetEvent( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestComplete,
+ 0,
+ FALSE);
- //
- // Clear out the extents
- // And get rid of them (note this involves waiting
- // for any writes or reads to the cache to complete)
- //
+ //
+ // Clear out the extents
+ // And get rid of them (note this involves waiting
+ // for any writes or reads to the cache to complete)
+ //
- AFSTearDownFcbExtents( ObjectInfo->Fcb,
- NULL);
+ AFSTearDownFcbExtents( ObjectInfo->Fcb,
+ NULL);
- AFSReleaseResource( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource);
- }
+ AFSReleaseResource( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource);
+ }
+ }
+
+ ObjectInfo->Links = 0;
break;
}