Author: fireball Date: Sun Oct 12 04:34:29 2008 New Revision: 36731
URL: http://svn.reactos.org/svn/reactos?rev=36731&view=rev Log: - Implement locking for Cc flush (the one used in NT5.2 results in a hang, might be because of a misused PagingIoResource). - If an acquire/release operation is not implemented, FSD must return STATUS_INVALID_DEVICE_REQUEST, not some other error code. - Fix a typo in the debug message.
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c trunk/reactos/drivers/filesystems/fastfat/fastio.c
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Sun Oct 12 04:34:29 2008 @@ -198,7 +198,7 @@
DPRINT ("FindFile(Parent %p, FileToFind '%wZ', DirIndex: %d)\n", Parent, FileToFindU, DirContext->DirIndex); - DPRINT ("FindFile: Path %wZ)\n",&Parent->PathNameU); + DPRINT ("FindFile: Path %wZ\n",&Parent->PathNameU);
PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR); PathNameBuffer = ExAllocatePoolWithTag(NonPagedPool, PathNameBufferLength + sizeof(WCHAR), TAG_VFAT);
Modified: trunk/reactos/drivers/filesystems/fastfat/fastio.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fastio.c [iso-8859-1] Sun Oct 12 04:34:29 2008 @@ -175,7 +175,7 @@ IN PDEVICE_OBJECT DeviceObject) { DPRINT("VfatAcquireForModWrite\n"); - return STATUS_UNSUCCESSFUL; + return STATUS_INVALID_DEVICE_REQUEST; }
static BOOLEAN NTAPI @@ -296,16 +296,34 @@ VfatAcquireForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject) { + PVFATFCB Fcb = (PVFATFCB)FileObject->FsContext; + DPRINT("VfatAcquireForCcFlush\n"); - return STATUS_INVALID_DEVICE_REQUEST; + + /* Make sure it is not a volume lock */ + ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); + + /* Acquire the resource */ + ExAcquireResourceExclusiveLite(&(Fcb->MainResource), TRUE); + + return STATUS_SUCCESS; }
static NTSTATUS NTAPI VfatReleaseForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject) { + PVFATFCB Fcb = (PVFATFCB)FileObject->FsContext; + DPRINT("VfatReleaseForCcFlush\n"); - return STATUS_INVALID_DEVICE_REQUEST; + + /* Make sure it is not a volume lock */ + ASSERT(!(Fcb->Flags & FCB_IS_VOLUME)); + + /* Release the resource */ + ExReleaseResourceLite(&(Fcb->MainResource)); + + return STATUS_SUCCESS; }
BOOLEAN NTAPI @@ -378,7 +396,6 @@ FastIoDispatch->ReleaseFileForNtCreateSection = VfatReleaseFileForNtCreateSection; FastIoDispatch->FastIoDetachDevice = VfatFastIoDetachDevice; FastIoDispatch->FastIoQueryNetworkOpenInfo = VfatFastIoQueryNetworkOpenInfo; - FastIoDispatch->AcquireForModWrite = VfatAcquireForModWrite; FastIoDispatch->MdlRead = VfatMdlRead; FastIoDispatch->MdlReadComplete = VfatMdlReadComplete; FastIoDispatch->PrepareMdlWrite = VfatPrepareMdlWrite; @@ -388,6 +405,7 @@ FastIoDispatch->MdlReadCompleteCompressed = VfatMdlReadCompleteCompressed; FastIoDispatch->MdlWriteCompleteCompressed = VfatMdlWriteCompleteCompressed; FastIoDispatch->FastIoQueryOpen = VfatFastIoQueryOpen; + FastIoDispatch->AcquireForModWrite = VfatAcquireForModWrite; FastIoDispatch->ReleaseForModWrite = VfatReleaseForModWrite; FastIoDispatch->AcquireForCcFlush = VfatAcquireForCcFlush; FastIoDispatch->ReleaseForCcFlush = VfatReleaseForCcFlush;