ReactOS  0.4.13-dev-482-ge57f103
cmcb.c File Reference
#include "ntifs.h"
#include "ffsdrv.h"
Include dependency graph for cmcb.c:

Go to the source code of this file.

Functions

__drv_mustHoldCriticalRegion BOOLEAN NTAPI FFSAcquireForLazyWrite (IN PVOID Context, IN BOOLEAN Wait)
 
__drv_mustHoldCriticalRegion VOID NTAPI FFSReleaseFromLazyWrite (IN PVOID Context)
 
__drv_mustHoldCriticalRegion BOOLEAN NTAPI FFSAcquireForReadAhead (IN PVOID Context, IN BOOLEAN Wait)
 
__drv_mustHoldCriticalRegion VOID NTAPI FFSReleaseFromReadAhead (IN PVOID Context)
 
BOOLEAN NTAPI FFSNoOpAcquire (IN PVOID Fcb, IN BOOLEAN Wait)
 
VOID NTAPI FFSNoOpRelease (IN PVOID Fcb)
 

Variables

PFFS_GLOBAL FFSGlobal
 

Function Documentation

◆ FFSAcquireForLazyWrite()

__drv_mustHoldCriticalRegion BOOLEAN NTAPI FFSAcquireForLazyWrite ( IN PVOID  Context,
IN BOOLEAN  Wait 
)

Definition at line 35 of file cmcb.c.

38 {
39  //
40  // On a readonly filesystem this function still has to exist but it
41  // doesn't need to do anything.
42 
43  PFFS_FCB Fcb;
44 
45  PAGED_CODE();
46 
47  Fcb = (PFFS_FCB)Context;
48 
49  ASSERT(Fcb != NULL);
50 
52  (Fcb->Identifier.Size == sizeof(FFS_FCB)));
53 
54  FFSPrint((DBG_INFO, "FFSAcquireForLazyWrite: %s %s %s\n",
56  "ACQUIRE_FOR_LAZY_WRITE",
57  Fcb->AnsiFileName.Buffer));
58 
59 
60  if (!IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY))
61  {
62  FFSPrint((DBG_INFO, "FFSAcquireForLazyWrite: Inode=%xh %S\n",
63  Fcb->FFSMcb->Inode, Fcb->FFSMcb->ShortName.Buffer));
64 
67  {
68  return FALSE;
69  }
70  }
71 
73 
75 
76  return TRUE;
77 }
Definition: ffsdrv.h:281
#define TRUE
Definition: types.h:120
struct _FFS_FCB * PFFS_FCB
#define PAGED_CODE()
Definition: video.h:57
NTFSIDENTIFIER Identifier
Definition: ntfs.h:499
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
#define FFSGetCurrentProcessName()
Definition: ffsdrv.h:1070
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
#define VCB_READ_ONLY
Definition: ext2fs.h:795
#define FFSPrint(arg)
Definition: ffsdrv.h:1047
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
ERESOURCE PagingIoResource
Definition: ntfs.h:511
PVCB Vcb
Definition: cdstruc.h:939
#define DBG_INFO
Definition: ffsdrv.h:1034
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
FILE_NAME_NODE ShortName
Definition: fatstruc.h:1111
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ FFSAcquireForReadAhead()

__drv_mustHoldCriticalRegion BOOLEAN NTAPI FFSAcquireForReadAhead ( IN PVOID  Context,
IN BOOLEAN  Wait 
)

Definition at line 121 of file cmcb.c.

124 {
125  PFFS_FCB Fcb;
126 
127  PAGED_CODE();
128 
129  Fcb = (PFFS_FCB)Context;
130 
131  ASSERT(Fcb != NULL);
132 
133  ASSERT((Fcb->Identifier.Type == FFSFCB) &&
134  (Fcb->Identifier.Size == sizeof(FFS_FCB)));
135 
136  FFSPrint((DBG_INFO, "FFSAcquireForReadAhead: Inode=%xh %S\n",
137  Fcb->FFSMcb->Inode, Fcb->FFSMcb->ShortName.Buffer));
138 
140  &Fcb->MainResource, Wait))
141  return FALSE;
142 
144 
146 
147  return TRUE;
148 }
Definition: ffsdrv.h:281
#define TRUE
Definition: types.h:120
struct _FFS_FCB * PFFS_FCB
#define PAGED_CODE()
Definition: video.h:57
NTFSIDENTIFIER Identifier
Definition: ntfs.h:499
smooth NULL
Definition: ftsmooth.c:416
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
ERESOURCE MainResource
Definition: ntfs.h:512
#define FFSPrint(arg)
Definition: ffsdrv.h:1047
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
#define DBG_INFO
Definition: ffsdrv.h:1034
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
FILE_NAME_NODE ShortName
Definition: fatstruc.h:1111
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ FFSNoOpAcquire()

BOOLEAN NTAPI FFSNoOpAcquire ( IN PVOID  Fcb,
IN BOOLEAN  Wait 
)

Definition at line 177 of file cmcb.c.

180 {
183 
184  //
185  // This is a kludge because Cc is really the top level. We it
186  // enters the file system, we will think it is a resursive call
187  // and complete the request with hard errors or verify. It will
188  // have to deal with them, somehow....
189  //
190 
191  PAGED_CODE();
192 
194 
196 
197  return TRUE;
198 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PAGED_CODE()
Definition: video.h:57
smooth NULL
Definition: ftsmooth.c:416
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ FFSNoOpRelease()

VOID NTAPI FFSNoOpRelease ( IN PVOID  Fcb)

Definition at line 202 of file cmcb.c.

204 {
205  //
206  // Clear the kludge at this point.
207  //
208 
209  PAGED_CODE();
210 
212 
214 
216 
217  return;
218 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PAGED_CODE()
Definition: video.h:57
smooth NULL
Definition: ftsmooth.c:416
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60

Referenced by DriverEntry().

◆ FFSReleaseFromLazyWrite()

__drv_mustHoldCriticalRegion VOID NTAPI FFSReleaseFromLazyWrite ( IN PVOID  Context)

Definition at line 82 of file cmcb.c.

84 {
85  //
86  // On a readonly filesystem this function still has to exist but it
87  // doesn't need to do anything.
88  PFFS_FCB Fcb;
89 
90  PAGED_CODE();
91 
92  Fcb = (PFFS_FCB)Context;
93 
94  ASSERT(Fcb != NULL);
95 
97  (Fcb->Identifier.Size == sizeof(FFS_FCB)));
98 
99  FFSPrint((DBG_INFO, "FFSReleaseFromLazyWrite: %s %s %s\n",
101  "RELEASE_FROM_LAZY_WRITE",
102  Fcb->AnsiFileName.Buffer));
103 
104  if (!IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY))
105  {
106  FFSPrint((DBG_INFO, "FFSReleaseFromLazyWrite: Inode=%xh %S\n",
107  Fcb->FFSMcb->Inode, Fcb->FFSMcb->ShortName.Buffer));
108 
110  }
111 
113 
115 
116 }
Definition: ffsdrv.h:281
struct _FFS_FCB * PFFS_FCB
#define PAGED_CODE()
Definition: video.h:57
NTFSIDENTIFIER Identifier
Definition: ntfs.h:499
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
#define FFSGetCurrentProcessName()
Definition: ffsdrv.h:1070
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
#define VCB_READ_ONLY
Definition: ext2fs.h:795
#define FFSPrint(arg)
Definition: ffsdrv.h:1047
ERESOURCE PagingIoResource
Definition: ntfs.h:511
PVCB Vcb
Definition: cdstruc.h:939
#define DBG_INFO
Definition: ffsdrv.h:1034
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
FILE_NAME_NODE ShortName
Definition: fatstruc.h:1111
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

◆ FFSReleaseFromReadAhead()

__drv_mustHoldCriticalRegion VOID NTAPI FFSReleaseFromReadAhead ( IN PVOID  Context)

Definition at line 153 of file cmcb.c.

155 {
156  PFFS_FCB Fcb;
157 
158  PAGED_CODE();
159 
160  Fcb = (PFFS_FCB)Context;
161 
162  ASSERT(Fcb != NULL);
163 
164  ASSERT((Fcb->Identifier.Type == FFSFCB) &&
165  (Fcb->Identifier.Size == sizeof(FFS_FCB)));
166 
167  FFSPrint((DBG_INFO, "FFSReleaseFromReadAhead: Inode=%xh %S\n",
168  Fcb->FFSMcb->Inode, Fcb->FFSMcb->ShortName.Buffer));
169 
171 
173 }
Definition: ffsdrv.h:281
struct _FFS_FCB * PFFS_FCB
#define PAGED_CODE()
Definition: video.h:57
NTFSIDENTIFIER Identifier
Definition: ntfs.h:499
smooth NULL
Definition: ftsmooth.c:416
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
ERESOURCE MainResource
Definition: ntfs.h:512
#define FFSPrint(arg)
Definition: ffsdrv.h:1047
#define DBG_INFO
Definition: ffsdrv.h:1034
_In_ PFCB Fcb
Definition: cdprocs.h:151
FILE_NAME_NODE ShortName
Definition: fatstruc.h:1111
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

Variable Documentation

◆ FFSGlobal

PFFS_GLOBAL FFSGlobal

Definition at line 22 of file init.c.