sys: initial fast I/O support

This commit is contained in:
Bill Zissimopoulos 2015-11-16 16:37:27 -08:00
parent 99c2a6a5e5
commit 1b18452663
6 changed files with 80 additions and 4 deletions

View File

@ -125,12 +125,13 @@
<ClCompile Include="..\..\src\sys\dirctrl.c" />
<ClCompile Include="..\..\src\sys\driver.c" />
<ClCompile Include="..\..\src\sys\ea.c" />
<ClCompile Include="..\..\src\sys\fastio.c" />
<ClCompile Include="..\..\src\sys\fileinfo.c" />
<ClCompile Include="..\..\src\sys\flush.c" />
<ClCompile Include="..\..\src\sys\fsctrl.c" />
<ClCompile Include="..\..\src\sys\lockctrl.c" />
<ClCompile Include="..\..\src\sys\read.c" />
<ClCompile Include="..\..\src\sys\seinfo.c" />
<ClCompile Include="..\..\src\sys\security.c" />
<ClCompile Include="..\..\src\sys\shutdown.c" />
<ClCompile Include="..\..\src\sys\volinfo.c" />
<ClCompile Include="..\..\src\sys\write.c" />

View File

@ -57,10 +57,13 @@
<ClCompile Include="..\..\src\sys\ea.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sys\seinfo.c">
<ClCompile Include="..\..\src\sys\shutdown.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sys\shutdown.c">
<ClCompile Include="..\..\src\sys\security.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sys\fastio.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>

View File

@ -64,6 +64,38 @@ DriverEntry(
DriverObject->MajorFunction[IRP_MJ_SET_QUOTA] = 0;
DriverObject->MajorFunction[IRP_MJ_PNP] = 0;
/* setup fast I/O */
static FAST_IO_DISPATCH FspFastIoDispatch = { 0 };
FspFastIoDispatch.SizeOfFastIoDispatch = sizeof FspFastIoDispatch;
FspFastIoDispatch.FastIoCheckIfPossible = FspFastIoCheckIfPossible;
FspFastIoDispatch.FastIoRead = FsRtlCopyRead;
FspFastIoDispatch.FastIoWrite = FsRtlCopyWrite;
FspFastIoDispatch.FastIoQueryBasicInfo = 0;
FspFastIoDispatch.FastIoQueryStandardInfo = 0;
FspFastIoDispatch.FastIoLock = 0;
FspFastIoDispatch.FastIoUnlockSingle = 0;
FspFastIoDispatch.FastIoUnlockAll = 0;
FspFastIoDispatch.FastIoUnlockAllByKey = 0;
FspFastIoDispatch.FastIoDeviceControl = 0;
FspFastIoDispatch.AcquireFileForNtCreateSection = 0;
FspFastIoDispatch.ReleaseFileForNtCreateSection = 0;
FspFastIoDispatch.FastIoDetachDevice = 0;
FspFastIoDispatch.FastIoQueryNetworkOpenInfo = 0;
FspFastIoDispatch.AcquireForModWrite = 0;
FspFastIoDispatch.MdlRead = FsRtlMdlReadDev;
FspFastIoDispatch.MdlReadComplete = FsRtlMdlReadCompleteDev;
FspFastIoDispatch.PrepareMdlWrite = FsRtlPrepareMdlWriteDev;
FspFastIoDispatch.MdlWriteComplete = FsRtlMdlWriteCompleteDev;
FspFastIoDispatch.FastIoReadCompressed = 0;
FspFastIoDispatch.FastIoWriteCompressed = 0;
FspFastIoDispatch.MdlReadCompleteCompressed = 0;
FspFastIoDispatch.MdlWriteCompleteCompressed = 0;
FspFastIoDispatch.FastIoQueryOpen = 0;
FspFastIoDispatch.ReleaseForModWrite = 0;
FspFastIoDispatch.AcquireForCcFlush = 0;
FspFastIoDispatch.ReleaseForCcFlush = 0;
DriverObject->FastIoDispatch = &FspFastIoDispatch;
return STATUS_SUCCESS;
}

View File

@ -7,7 +7,7 @@
#ifndef WINFSP_SYS_DRIVER_H_INCLUDED
#define WINFSP_SYS_DRIVER_H_INCLUDED
#include <wdm.h>
#include <ntifs.h>
#define DRIVER_NAME "winfsp"
@ -39,4 +39,7 @@ DRIVER_DISPATCH FspSetVolumeInformation;
DRIVER_DISPATCH FspShutdown;
DRIVER_DISPATCH FspWrite;
/* fast I/O */
FAST_IO_CHECK_IF_POSSIBLE FspFastIoCheckIfPossible;
#endif

37
src/sys/fastio.c Normal file
View File

@ -0,0 +1,37 @@
/**
* @file sys/fastio.c
*
* @copyright 2015 Bill Zissimopoulos
*/
#include <sys/driver.h>
FAST_IO_CHECK_IF_POSSIBLE FspFastIoCheckIfPossible;
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, FspFastIoCheckIfPossible)
#endif
BOOLEAN
FspFastIoCheckIfPossible(
_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
)
{
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;
}