AFSWaitOnQueuedFlushes( pFcb);
ulNotificationFlags |= AFS_REQUEST_FLAG_FLUSH_FILE;
+
+ AFSTearDownFcbExtents( pFcb,
+ &pCcb->AuthGroup);
}
//
NTSTATUS
AFSReleaseExtentsWithFlush( IN AFSFcb *Fcb,
- IN GUID *AuthGroup)
+ IN GUID *AuthGroup,
+ IN BOOLEAN bReleaseAll)
{
AFSNonPagedFcb *pNPFcb = Fcb->NPFcb;
AFSExtent *pExtent;
try_return ( ntStatus = STATUS_INSUFFICIENT_RESOURCES );
}
- if( Fcb->OpenHandleCount > 0)
+ if( Fcb->OpenHandleCount > 0 &&
+ !bReleaseAll)
{
//
// Don't release everything ...
//
- //
- // For now release everything
- //
-
- //ulRemainingExtentLength = 1500;
+ ulRemainingExtentLength = 1024;
}
while( Fcb->Specific.File.ExtentLength > (LONG)ulRemainingExtentLength)
{
AFSReleaseExtentsWithFlush( pFcb,
- &pCcb->AuthGroup);
+ &pCcb->AuthGroup,
+ TRUE);
ntStatus = STATUS_SUCCESS;
}
{
AFSReleaseExtentsWithFlush( Fcb,
- NULL);
+ NULL,
+ TRUE);
}
}
{
AFSReleaseExtentsWithFlush( Fcb,
- NULL);
+ NULL,
+ TRUE);
}
}
// The data is there now. Give back the extents now so the service
// has some in hand
//
- (VOID) AFSReleaseExtentsWithFlush( pFcb,
- &pCcb->AuthGroup);
+
+ if ( pFcb->Specific.File.ExtentLength > 4096)
+ {
+
+ (VOID) AFSReleaseExtentsWithFlush( pFcb,
+ &pCcb->AuthGroup,
+ FALSE);
+ }
try_exit:
{
AFSReleaseExtentsWithFlush( pWorkItem->Specific.Fcb.Fcb,
- &pWorkItem->AuthGroup);
+ &pWorkItem->AuthGroup,
+ FALSE);
}
ASSERT( pWorkItem->Specific.Fcb.Fcb->OpenReferenceCount != 0);
NTSTATUS
AFSReleaseExtentsWithFlush( IN AFSFcb *Fcb,
- IN GUID *AuthGroup);
+ IN GUID *AuthGroup,
+ IN BOOLEAN bReleaseAll);
NTSTATUS
AFSReleaseCleanExtents( IN AFSFcb *Fcb,