ReactOS  0.4.14-dev-297-g23e575c
cmcb.c File Reference
#include "rfsd.h"
Include dependency graph for cmcb.c:

Go to the source code of this file.

Functions

__drv_mustHoldCriticalRegion BOOLEAN NTAPI RfsdAcquireForLazyWrite (IN PVOID Context, IN BOOLEAN Wait)
 
__drv_mustHoldCriticalRegion VOID NTAPI RfsdReleaseFromLazyWrite (IN PVOID Context)
 
__drv_mustHoldCriticalRegion BOOLEAN NTAPI RfsdAcquireForReadAhead (IN PVOID Context, IN BOOLEAN Wait)
 
__drv_mustHoldCriticalRegion VOID NTAPI RfsdReleaseFromReadAhead (IN PVOID Context)
 
BOOLEAN NTAPI RfsdNoOpAcquire (IN PVOID Fcb, IN BOOLEAN Wait)
 
VOID NTAPI RfsdNoOpRelease (IN PVOID Fcb)
 

Variables

PRFSD_GLOBAL RfsdGlobal
 

Function Documentation

◆ RfsdAcquireForLazyWrite()

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

Definition at line 32 of file cmcb.c.

35 {
36  PRFSD_FCB Fcb;
37 
38  PAGED_CODE();
39 
40  Fcb = (PRFSD_FCB) Context;
41 
42  ASSERT(Fcb != NULL);
43 
45  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
46 
47  RfsdPrint((DBG_INFO, "RfsdAcquireForLazyWrite: %s %s %s\n",
49  "ACQUIRE_FOR_LAZY_WRITE",
50  Fcb->AnsiFileName.Buffer ));
51 
52  if (!IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY)) {
53  RfsdPrint(( DBG_INFO, "RfsdAcquireForLazyWrite: Key=%x,%xh %S\n",
54  Fcb->RfsdMcb->Key.k_dir_id, Fcb->RfsdMcb->Key.k_objectid, Fcb->RfsdMcb->ShortName.Buffer ));
55 
58  return FALSE;
59  }
60  }
61 
63 
65 
66  return TRUE;
67 }
#define TRUE
Definition: types.h:120
#define PAGED_CODE()
Definition: video.h:57
Definition: rfsd.h:324
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
#define RfsdGetCurrentProcessName()
Definition: rfsd.h:1095
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
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ULONG Type
Definition: ntfs.h:95
#define VCB_READ_ONLY
Definition: ext2fs.h:795
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
ERESOURCE PagingIoResource
Definition: ntfs.h:523
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:1114
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ RfsdAcquireForReadAhead()

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

Definition at line 104 of file cmcb.c.

106 {
107  PRFSD_FCB Fcb;
108 
109  PAGED_CODE();
110 
111  Fcb = (PRFSD_FCB) Context;
112 
113  ASSERT(Fcb != NULL);
114 
115  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
116  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
117 
118  RfsdPrint(( DBG_INFO, "RfsdAcquireForReadAhead: Inode=%x,%xh %S\n",
119  Fcb->RfsdMcb->Key.k_dir_id, Fcb->RfsdMcb->Key.k_objectid, Fcb->RfsdMcb->ShortName.Buffer ));
120 
122  &Fcb->MainResource, Wait ))
123  return FALSE;
124 
126 
128 
129  return TRUE;
130 }
#define TRUE
Definition: types.h:120
#define PAGED_CODE()
Definition: video.h:57
Definition: rfsd.h:324
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
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
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ULONG Type
Definition: ntfs.h:95
ERESOURCE MainResource
Definition: ntfs.h:524
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:1114
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ RfsdNoOpAcquire()

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

Definition at line 156 of file cmcb.c.

160 {
163 
164  PAGED_CODE();
165 
166  //
167  // This is a kludge because Cc is really the top level. We it
168  // enters the file system, we will think it is a resursive call
169  // and complete the request with hard errors or verify. It will
170  // have to deal with them, somehow....
171  //
172 
174 
176 
177  return TRUE;
178 }
#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().

◆ RfsdNoOpRelease()

VOID NTAPI RfsdNoOpRelease ( IN PVOID  Fcb)

Definition at line 181 of file cmcb.c.

184 {
185  PAGED_CODE();
186 
187  //
188  // Clear the kludge at this point.
189  //
190 
192 
194 
196 
197  return;
198 }
#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().

◆ RfsdReleaseFromLazyWrite()

__drv_mustHoldCriticalRegion VOID NTAPI RfsdReleaseFromLazyWrite ( IN PVOID  Context)

Definition at line 71 of file cmcb.c.

72 {
73  PRFSD_FCB Fcb;
74 
75  PAGED_CODE();
76 
77  Fcb = (PRFSD_FCB) Context;
78 
79  ASSERT(Fcb != NULL);
80 
82  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
83 
84  RfsdPrint((DBG_INFO, "RfsdReleaseFromLazyWrite: %s %s %s\n",
86  "RELEASE_FROM_LAZY_WRITE",
87  Fcb->AnsiFileName.Buffer
88  ));
89 
90  if (!IsFlagOn(Fcb->Vcb->Flags, VCB_READ_ONLY)) {
91  RfsdPrint(( DBG_INFO, "RfsdReleaseFromLazyWrite: Inode=%x%xh %S\n",
92  Fcb->RfsdMcb->Key.k_dir_id, Fcb->RfsdMcb->Key.k_objectid, Fcb->RfsdMcb->ShortName.Buffer ));
93 
95  }
96 
98 
100 }
#define PAGED_CODE()
Definition: video.h:57
Definition: rfsd.h:324
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
smooth NULL
Definition: ftsmooth.c:416
#define RfsdGetCurrentProcessName()
Definition: rfsd.h:1095
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
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ULONG Type
Definition: ntfs.h:95
#define VCB_READ_ONLY
Definition: ext2fs.h:795
ERESOURCE PagingIoResource
Definition: ntfs.h:523
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:1114
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

◆ RfsdReleaseFromReadAhead()

__drv_mustHoldCriticalRegion VOID NTAPI RfsdReleaseFromReadAhead ( IN PVOID  Context)

Definition at line 134 of file cmcb.c.

135 {
136  PRFSD_FCB Fcb;
137 
138  PAGED_CODE();
139 
140  Fcb = (PRFSD_FCB) Context;
141 
142  ASSERT(Fcb != NULL);
143 
144  ASSERT((Fcb->Identifier.Type == RFSDFCB) &&
145  (Fcb->Identifier.Size == sizeof(RFSD_FCB)));
146 
147  RfsdPrint(( DBG_INFO, "RfsdReleaseFromReadAhead: Inode=%x,%xh %S\n",
148  Fcb->RfsdMcb->Key.k_dir_id, Fcb->RfsdMcb->Key.k_objectid, Fcb->RfsdMcb->ShortName.Buffer ));
149 
151 
153 }
#define PAGED_CODE()
Definition: video.h:57
Definition: rfsd.h:324
struct _RFSD_FCB * PRFSD_FCB
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
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
#define RfsdPrint(arg)
Definition: rfsd.h:1069
ULONG Type
Definition: ntfs.h:95
ERESOURCE MainResource
Definition: ntfs.h:524
#define DBG_INFO
Definition: ffsdrv.h:1034
_In_ PFCB Fcb
Definition: cdprocs.h:151
FILE_NAME_NODE ShortName
Definition: fatstruc.h:1114
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

Variable Documentation

◆ RfsdGlobal

PRFSD_GLOBAL RfsdGlobal

Definition at line 17 of file init.c.