From c5caa4ae8906be46f72fac7df6977cc422be1be3 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 8 Mar 2008 13:17:48 +0000 Subject: [PATCH] Added stubs for CC R/W functions (fixes TODO from r32610) svn path=/trunk/; revision=32611 --- reactos/drivers/filesystems/ntfs/fastio.c | 64 ++++++++++++++++++++ reactos/drivers/filesystems/ntfs/fcb.c | 4 +- reactos/drivers/filesystems/ntfs/fsctl.c | 4 +- reactos/drivers/filesystems/ntfs/ntfs.c | 7 +++ reactos/drivers/filesystems/ntfs/ntfs.h | 16 +++++ reactos/drivers/filesystems/ntfs/ntfs.rbuild | 1 + 6 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 reactos/drivers/filesystems/ntfs/fastio.c diff --git a/reactos/drivers/filesystems/ntfs/fastio.c b/reactos/drivers/filesystems/ntfs/fastio.c new file mode 100644 index 00000000000..230b305bfc1 --- /dev/null +++ b/reactos/drivers/filesystems/ntfs/fastio.c @@ -0,0 +1,64 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/filesystem/ntfs/fastio.c + * PURPOSE: NTFS filesystem driver + * PROGRAMMER: Pierre Schweitzer + */ + +/* INCLUDES *****************************************************************/ + +#include + +#define NDEBUG +#include + +#include "ntfs.h" + + +/* FUNCTIONS ****************************************************************/ + +BOOLEAN NTAPI +NtfsAcqLazyWrite(PVOID Context, + BOOLEAN Wait) +{ + UNIMPLEMENTED; + return FALSE; +} + +VOID NTAPI +NtfsRelLazyWrite(PVOID Context) +{ + UNIMPLEMENTED; +} + +BOOLEAN NTAPI +NtfsAcqReadAhead(PVOID Context, + BOOLEAN Wait) +{ + UNIMPLEMENTED; + return FALSE; +} + +VOID NTAPI +NtfsRelReadAhead(PVOID Context) +{ + UNIMPLEMENTED; +} diff --git a/reactos/drivers/filesystems/ntfs/fcb.c b/reactos/drivers/filesystems/ntfs/fcb.c index 17520ecbcf3..516ac897244 100644 --- a/reactos/drivers/filesystems/ntfs/fcb.c +++ b/reactos/drivers/filesystems/ntfs/fcb.c @@ -243,8 +243,8 @@ NtfsFCBInitializeCache(PVCB Vcb, CcInitializeCacheMap(FileObject, (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize), FALSE, - NULL, - NULL); + &(NtfsGlobalData->CacheMgrCallbacks), + Fcb); ObDereferenceObject(FileObject); Fcb->Flags |= FCB_CACHE_INITIALIZED; diff --git a/reactos/drivers/filesystems/ntfs/fsctl.c b/reactos/drivers/filesystems/ntfs/fsctl.c index 8519307c9d6..d4eab5d2a97 100644 --- a/reactos/drivers/filesystems/ntfs/fsctl.c +++ b/reactos/drivers/filesystems/ntfs/fsctl.c @@ -404,8 +404,8 @@ NtfsMountVolume(PDEVICE_OBJECT DeviceObject, CcInitializeCacheMap(DeviceExt->StreamFileObject, (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize), FALSE, - NULL, - NULL); + &(NtfsGlobalData->CacheMgrCallbacks), + Fcb); ExInitializeResourceLite(&DeviceExt->DirResource); // ExInitializeResourceLite(&DeviceExt->FatResource); diff --git a/reactos/drivers/filesystems/ntfs/ntfs.c b/reactos/drivers/filesystems/ntfs/ntfs.c index d449ec43a05..ce3cd6372ea 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.c +++ b/reactos/drivers/filesystems/ntfs/ntfs.c @@ -72,6 +72,13 @@ DriverEntry(PDRIVER_OBJECT DriverObject, /* Initialize IRP functions array */ NtfsInitializeFunctionPointers(DriverObject); + + /* Initialize CC functions array */ + NtfsGlobalData->CacheMgrCallbacks.AcquireForLazyWrite = NtfsAcqLazyWrite; + NtfsGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite = NtfsRelLazyWrite; + NtfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = NtfsAcqReadAhead; + NtfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = NtfsRelReadAhead; + /* Driver can't be unloaded */ DriverObject->DriverUnload = NULL; diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 200edb648f7..cff4db578b2 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -166,6 +166,7 @@ typedef struct ERESOURCE Resource; PDRIVER_OBJECT DriverObject; PDEVICE_OBJECT DeviceObject; + CACHE_MANAGER_CALLBACKS CacheMgrCallbacks; ULONG Flags; } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA; @@ -401,6 +402,21 @@ NTSTATUS NTAPI NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp); +/* fastio.c */ +BOOLEAN NTAPI +NtfsAcqLazyWrite(PVOID Context, + BOOLEAN Wait); + +VOID NTAPI +NtfsRelLazyWrite(PVOID Context); + +BOOLEAN NTAPI +NtfsAcqReadAhead(PVOID Context, + BOOLEAN Wait); + +VOID NTAPI +NtfsRelReadAhead(PVOID Context); + /* fcb.c */ PFCB diff --git a/reactos/drivers/filesystems/ntfs/ntfs.rbuild b/reactos/drivers/filesystems/ntfs/ntfs.rbuild index 09d0d099a2c..76e974fb795 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.rbuild +++ b/reactos/drivers/filesystems/ntfs/ntfs.rbuild @@ -11,6 +11,7 @@ create.c dirctl.c dispatch.c + fastio.c fcb.c finfo.c fsctl.c