mirror of
https://github.com/reactos/reactos.git
synced 2024-09-04 09:39:07 +00:00
[FASTFAT]
Fix a FIXME in fastfat: - Implement support for device buffers flush in VfatFlushVolume(). Unlike Windows SDK, we don't divert the current IRP to pass it to storage device. Here, we allocate a new IRP and call the device so that it flushes buffers. svn path=/trunk/; revision=65526
This commit is contained in:
parent
fa9b68d4bb
commit
8d5e230523
|
@ -52,6 +52,9 @@ VfatFlushVolume(
|
||||||
PLIST_ENTRY ListEntry;
|
PLIST_ENTRY ListEntry;
|
||||||
PVFATFCB Fcb;
|
PVFATFCB Fcb;
|
||||||
NTSTATUS Status, ReturnStatus = STATUS_SUCCESS;
|
NTSTATUS Status, ReturnStatus = STATUS_SUCCESS;
|
||||||
|
PIRP Irp;
|
||||||
|
KEVENT Event;
|
||||||
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
|
|
||||||
DPRINT("VfatFlushVolume(DeviceExt %p, FatFcb %p)\n", DeviceExt, VolumeFcb);
|
DPRINT("VfatFlushVolume(DeviceExt %p, FatFcb %p)\n", DeviceExt, VolumeFcb);
|
||||||
|
|
||||||
|
@ -99,7 +102,34 @@ VfatFlushVolume(
|
||||||
Status = VfatFlushFile(DeviceExt, Fcb);
|
Status = VfatFlushFile(DeviceExt, Fcb);
|
||||||
ExReleaseResourceLite(&DeviceExt->FatResource);
|
ExReleaseResourceLite(&DeviceExt->FatResource);
|
||||||
|
|
||||||
/* FIXME: Flush the buffers from storage device */
|
/* Prepare an IRP to flush device buffers */
|
||||||
|
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_FLUSH_BUFFERS,
|
||||||
|
DeviceExt->StorageDevice,
|
||||||
|
NULL, 0, NULL, &Event,
|
||||||
|
&IoStatusBlock);
|
||||||
|
if (Irp != NULL)
|
||||||
|
{
|
||||||
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||||
|
|
||||||
|
Status = IoCallDriver(DeviceExt->StorageDevice, Irp);
|
||||||
|
if (Status == STATUS_PENDING)
|
||||||
|
{
|
||||||
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||||
|
Status = Irp->IoStatus.Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ignore device not supporting flush operation */
|
||||||
|
if (Status == STATUS_INVALID_DEVICE_REQUEST)
|
||||||
|
{
|
||||||
|
DPRINT1("Flush not supported, ignored\n");
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue