[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Fri, 1 May 2015 18:38:10 +0000 (18:38 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Fri, 1 May 2015 18:38:10 +0000 (18:38 +0000)
Add FastIO non-support in NTFS

svn path=/trunk/; revision=67501

reactos/drivers/filesystems/ntfs/fastio.c
reactos/drivers/filesystems/ntfs/ntfs.c
reactos/drivers/filesystems/ntfs/ntfs.h

index fc77833..b936c8b 100644 (file)
@@ -75,4 +75,74 @@ NtfsRelReadAhead(PVOID Context)
     UNIMPLEMENTED;
 }
 
+BOOLEAN
+NTAPI
+NtfsFastIoCheckIfPossible(
+    _In_ PFILE_OBJECT FileObject,
+    _In_ PLARGE_INTEGER FileOffset,
+    _In_ ULONG Length,
+    _In_ BOOLEAN Wait,
+    _In_ ULONG LockKey,
+    _In_ BOOLEAN CheckForReadOperation,
+    _Out_ PIO_STATUS_BLOCK IoStatus,
+    _In_ PDEVICE_OBJECT DeviceObject)
+{
+    /* Deny FastIo */
+    UNREFERENCED_PARAMETER(FileObject);
+    UNREFERENCED_PARAMETER(FileOffset);
+    UNREFERENCED_PARAMETER(Length);
+    UNREFERENCED_PARAMETER(Wait);
+    UNREFERENCED_PARAMETER(LockKey);
+    UNREFERENCED_PARAMETER(CheckForReadOperation);
+    UNREFERENCED_PARAMETER(IoStatus);
+    UNREFERENCED_PARAMETER(DeviceObject);
+    return FALSE;
+}
+
+BOOLEAN
+NTAPI
+NtfsFastIoRead(
+    _In_ PFILE_OBJECT FileObject,
+    _In_ PLARGE_INTEGER FileOffset,
+    _In_ ULONG Length,
+    _In_ BOOLEAN Wait,
+    _In_ ULONG LockKey,
+    _Out_ PVOID Buffer,
+    _Out_ PIO_STATUS_BLOCK IoStatus,
+    _In_ PDEVICE_OBJECT DeviceObject)
+{
+    DBG_UNREFERENCED_PARAMETER(FileObject);
+    DBG_UNREFERENCED_PARAMETER(FileOffset);
+    DBG_UNREFERENCED_PARAMETER(Length);
+    DBG_UNREFERENCED_PARAMETER(Wait);
+    DBG_UNREFERENCED_PARAMETER(LockKey);
+    DBG_UNREFERENCED_PARAMETER(Buffer);
+    DBG_UNREFERENCED_PARAMETER(IoStatus);
+    DBG_UNREFERENCED_PARAMETER(DeviceObject);
+    return FALSE;
+}
+
+BOOLEAN
+NTAPI
+NtfsFastIoWrite(
+    _In_ PFILE_OBJECT FileObject,
+    _In_ PLARGE_INTEGER FileOffset,
+    _In_ ULONG Length,
+    _In_ BOOLEAN Wait,
+    _In_ ULONG LockKey,
+    _In_ PVOID Buffer,
+    _Out_ PIO_STATUS_BLOCK IoStatus,
+    _In_ PDEVICE_OBJECT DeviceObject)
+{
+    DBG_UNREFERENCED_PARAMETER(FileObject);
+    DBG_UNREFERENCED_PARAMETER(FileOffset);
+    DBG_UNREFERENCED_PARAMETER(Length);
+    DBG_UNREFERENCED_PARAMETER(Wait);
+    DBG_UNREFERENCED_PARAMETER(LockKey);
+    DBG_UNREFERENCED_PARAMETER(Buffer);
+    DBG_UNREFERENCED_PARAMETER(IoStatus);
+    DBG_UNREFERENCED_PARAMETER(DeviceObject);
+    return FALSE;
+}
+
 /* EOF */
index 090ee68..324b5b9 100644 (file)
@@ -80,6 +80,12 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     NtfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = NtfsAcqReadAhead; 
     NtfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = NtfsRelReadAhead; 
 
+    NtfsGlobalData->FastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
+    NtfsGlobalData->FastIoDispatch.FastIoCheckIfPossible = NtfsFastIoCheckIfPossible;
+    NtfsGlobalData->FastIoDispatch.FastIoRead = NtfsFastIoRead;
+    NtfsGlobalData->FastIoDispatch.FastIoWrite = NtfsFastIoWrite;
+    DriverObject->FastIoDispatch = &NtfsGlobalData->FastIoDispatch;
+
     /* Driver can't be unloaded */
     DriverObject->DriverUnload = NULL;
 
index 44b8874..5efb1e9 100644 (file)
@@ -136,6 +136,7 @@ typedef struct
     PDEVICE_OBJECT DeviceObject;
     CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
     ULONG Flags;
+    FAST_IO_DISPATCH FastIoDispatch;
 } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA;
 
 
@@ -566,6 +567,10 @@ NtfsAcqReadAhead(PVOID Context,
 VOID NTAPI
 NtfsRelReadAhead(PVOID Context);
 
+FAST_IO_CHECK_IF_POSSIBLE NtfsFastIoCheckIfPossible;
+FAST_IO_READ NtfsFastIoRead;
+FAST_IO_WRITE NtfsFastIoWrite;
+
 
 /* fcb.c */