Author: fireball
Date: Sat Mar 8 11:35:32 2008
New Revision: 32607
URL:
http://svn.reactos.org/svn/reactos?rev=3D32607&view=3Drev
Log:
- Pass cache manager callbacks structure at every CcInitializeCacheMap() ca=
ll, it's mandatory.
Modified:
trunk/reactos/drivers/filesystems/cdfs/cdfs.c
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/fcb.c
trunk/reactos/drivers/filesystems/cdfs/fsctl.c
trunk/reactos/drivers/filesystems/cdfs/rw.c
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/c=
dfs/cdfs.c?rev=3D32607&r1=3D32606&r2=3D32607&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.c (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.c Sat Mar 8 11:35:32 2008
@@ -33,7 +33,7 @@
#define NDEBUG
#include <debug.h>
=
-/* FUNCTIONS *************************************************************=
***/
+/* GLOBALS ***************************************************************=
***/
=
PCDFS_GLOBAL_DATA CdfsGlobalData;
=
@@ -98,9 +98,41 @@
=
DriverObject->DriverUnload =3D NULL;
=
+ /* Cache manager */
+ CdfsGlobalData->CacheMgrCallbacks.AcquireForLazyWrite =3D CdfsAcquireFor=
LazyWrite;
+ CdfsGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite =3D CdfsReleaseFr=
omLazyWrite;
+ CdfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead =3D CdfsAcquireFor=
LazyWrite;
+ CdfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead =3D CdfsReleaseFr=
omLazyWrite;
+
IoRegisterFileSystem(DeviceObject);
DeviceObject->Flags &=3D ~DO_DEVICE_INITIALIZING;
=
return(STATUS_SUCCESS);
}
=
+
+BOOLEAN NTAPI
+CdfsAcquireForLazyWrite(IN PVOID Context,
+ IN BOOLEAN Wait)
+{
+ PFCB Fcb =3D (PFCB)Context;
+ ASSERT(Fcb);
+ DPRINT("CdfsAcquireForLazyWrite(): Fcb %p\n", Fcb);
+
+ if (!ExAcquireResourceExclusiveLite(&(Fcb->MainResource), Wait))
+ {
+ DPRINT("CdfsAcquireForLazyWrite(): ExReleaseResourceLite failed.\n");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+VOID NTAPI
+CdfsReleaseFromLazyWrite(IN PVOID Context)
+{
+ PFCB Fcb =3D (PFCB)Context;
+ ASSERT(Fcb);
+ DPRINT("CdfsReleaseFromLazyWrite(): Fcb %p\n", Fcb);
+
+ ExReleaseResourceLite(&(Fcb->MainResource));
+}
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/c=
dfs/cdfs.h?rev=3D32607&r1=3D32606&r2=3D32607&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h Sat Mar 8 11:35:32 2008
@@ -178,6 +178,7 @@
{
FSRTL_COMMON_FCB_HEADER RFCB;
SECTION_OBJECT_POINTERS SectionObjectPointers;
+ ERESOURCE MainResource;
ERESOURCE PagingIoResource;
=
PFILE_OBJECT FileObject;
@@ -188,8 +189,6 @@
WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */
WCHAR PathName[MAX_PATH]; /* path+filename 260 max */
WCHAR ShortNameBuffer[13];
-
- ERESOURCE MainResource;
=
LIST_ENTRY FcbListEntry;
struct _FCB* ParentFcb;
@@ -233,6 +232,7 @@
PDRIVER_OBJECT DriverObject;
PDEVICE_OBJECT DeviceObject;
ULONG Flags;
+ CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
} CDFS_GLOBAL_DATA, *PCDFS_GLOBAL_DATA;
=
extern PCDFS_GLOBAL_DATA CdfsGlobalData;
@@ -418,4 +418,11 @@
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath);
=
+BOOLEAN NTAPI
+CdfsAcquireForLazyWrite(IN PVOID Context,
+ IN BOOLEAN Wait);
+
+VOID NTAPI
+CdfsReleaseFromLazyWrite(IN PVOID Context);
+
#endif //CDFS_H
Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/c=
dfs/fcb.c?rev=3D32607&r1=3D32606&r2=3D32607&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/drivers/filesystems/cdfs/fcb.c (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fcb.c Sat Mar 8 11:35:32 2008
@@ -245,8 +245,8 @@
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
- NULL,
- NULL);
+ &(CdfsGlobalData->CacheMgrCallbacks),
+ Fcb);
=
ObDereferenceObject(FileObject);
Fcb->Flags |=3D FCB_CACHE_INITIALIZED;
@@ -430,8 +430,8 @@
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
- NULL,
- NULL);
+ &(CdfsGlobalData->CacheMgrCallbacks),
+ Fcb);
Fcb->Flags |=3D FCB_CACHE_INITIALIZED;
}
=
Modified: trunk/reactos/drivers/filesystems/cdfs/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/c=
dfs/fsctl.c?rev=3D32607&r1=3D32606&r2=3D32607&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/drivers/filesystems/cdfs/fsctl.c (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fsctl.c Sat Mar 8 11:35:32 2008
@@ -402,8 +402,8 @@
CcInitializeCacheMap(DeviceExt->StreamFileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
TRUE,
- NULL,
- NULL);
+ &(CdfsGlobalData->CacheMgrCallbacks),
+ Fcb);
=
ExInitializeResourceLite(&DeviceExt->VcbResource);
ExInitializeResourceLite(&DeviceExt->DirResource);
Modified: trunk/reactos/drivers/filesystems/cdfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/c=
dfs/rw.c?rev=3D32607&r1=3D32606&r2=3D32607&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/drivers/filesystems/cdfs/rw.c (original)
+++ trunk/reactos/drivers/filesystems/cdfs/rw.c Sat Mar 8 11:35:32 2008
@@ -85,8 +85,8 @@
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
- NULL,
- NULL);
+ &(CdfsGlobalData->CacheMgrCallbacks),
+ Fcb);
}
=
FileOffset.QuadPart =3D (LONGLONG)ReadOffset;