ReactOS  0.4.14-dev-49-gfb4591c
cmcb.c File Reference
#include "ext2fs.h"
Include dependency graph for cmcb.c:

Go to the source code of this file.

Macros

#define CMCB_DEBUG_LEVEL   DL_NVR
 

Functions

BOOLEAN NTAPI Ext2AcquireForLazyWrite (IN PVOID Context, IN BOOLEAN Wait)
 
VOID NTAPI Ext2ReleaseFromLazyWrite (IN PVOID Context)
 
BOOLEAN NTAPI Ext2AcquireForReadAhead (IN PVOID Context, IN BOOLEAN Wait)
 
VOID NTAPI Ext2ReleaseFromReadAhead (IN PVOID Context)
 
BOOLEAN NTAPI Ext2NoOpAcquire (IN PVOID Fcb, IN BOOLEAN Wait)
 
VOID NTAPI Ext2NoOpRelease (IN PVOID Fcb)
 

Variables

PEXT2_GLOBAL Ext2Global
 

Macro Definition Documentation

◆ CMCB_DEBUG_LEVEL

#define CMCB_DEBUG_LEVEL   DL_NVR

Definition at line 20 of file cmcb.c.

Function Documentation

◆ Ext2AcquireForLazyWrite()

BOOLEAN NTAPI Ext2AcquireForLazyWrite ( IN PVOID  Context,
IN BOOLEAN  Wait 
)

Definition at line 23 of file cmcb.c.

26 {
27  //
28  // On a readonly filesystem this function still has to exist but it
29  // doesn't need to do anything.
30 
31  PEXT2_FCB Fcb;
32 
33  Fcb = (PEXT2_FCB) Context;
34  ASSERT(Fcb != NULL);
36  (Fcb->Identifier.Size == sizeof(EXT2_FCB)));
37 #if EXT2_DEBUG
38  DEBUG(CMCB_DEBUG_LEVEL, ("Ext2AcquireForLazyWrite: %s %s Fcb=%p\n",
39  Ext2GetCurrentProcessName(), "ACQUIRE_FOR_LAZY_WRITE", Fcb));
40 #endif
41  if (!ExAcquireResourceExclusiveLite(Fcb->Header.Resource, Wait)) {
42  return FALSE;
43  }
44 
45  ASSERT(Fcb->LazyWriterThread == NULL);
46  Fcb->LazyWriterThread = PsGetCurrentThread();
47 
50 
51  return TRUE;
52 }
struct _EXT2_FCB * PEXT2_FCB
#define TRUE
Definition: types.h:120
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
#define Ext2GetCurrentProcessName()
Definition: ext2fs.h:1452
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define CMCB_DEBUG_LEVEL
Definition: cmcb.c:20
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
#define DEBUG(args)
Definition: rdesktop.h:129
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ Ext2AcquireForReadAhead()

BOOLEAN NTAPI Ext2AcquireForReadAhead ( IN PVOID  Context,
IN BOOLEAN  Wait 
)

Definition at line 80 of file cmcb.c.

82 {
84 
85  ASSERT(Fcb != NULL);
87  (Fcb->Identifier.Size == sizeof(EXT2_FCB)));
88 
89  DEBUG(CMCB_DEBUG_LEVEL, ("Ext2AcquireForReadAhead: i=%xh Fcb=%p\n",
90  Fcb->Mcb->Inode.i_ino, Fcb));
91 
92  if (!ExAcquireResourceSharedLite(Fcb->Header.Resource, Wait))
93  return FALSE;
96 
97  return TRUE;
98 }
struct _EXT2_FCB * PEXT2_FCB
#define TRUE
Definition: types.h:120
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define CMCB_DEBUG_LEVEL
Definition: cmcb.c:20
smooth NULL
Definition: ftsmooth.c:416
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
CD_MCB Mcb
Definition: cdstruc.h:1022
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
BOOLEAN NTAPI ExAcquireResourceSharedLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:885
#define DEBUG(args)
Definition: rdesktop.h:129
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
ULONG Size
Definition: ntfs.h:96
IN BOOLEAN Wait
Definition: fatprocs.h:1529

Referenced by DriverEntry().

◆ Ext2NoOpAcquire()

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

Definition at line 118 of file cmcb.c.

122 {
125  return TRUE;
126 }
#define TRUE
Definition: types.h:120
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 FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60

Referenced by DriverEntry().

◆ Ext2NoOpRelease()

VOID NTAPI Ext2NoOpRelease ( IN PVOID  Fcb)

Definition at line 129 of file cmcb.c.

132 {
135 
136  return;
137 }
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 FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60

Referenced by DriverEntry().

◆ Ext2ReleaseFromLazyWrite()

VOID NTAPI Ext2ReleaseFromLazyWrite ( IN PVOID  Context)

Definition at line 55 of file cmcb.c.

56 {
57  //
58  // On a readonly filesystem this function still has to exist but it
59  // doesn't need to do anything.
61 
62  ASSERT(Fcb != NULL);
63 
65  (Fcb->Identifier.Size == sizeof(EXT2_FCB)));
66 #if EXT2_DEBUG
67  DEBUG(CMCB_DEBUG_LEVEL, ( "Ext2ReleaseFromLazyWrite: %s %s Fcb=%p\n",
68  Ext2GetCurrentProcessName(), "RELEASE_FROM_LAZY_WRITE", Fcb));
69 #endif
70  ASSERT(Fcb->LazyWriterThread == PsGetCurrentThread());
71  Fcb->LazyWriterThread = NULL;
72 
73  ExReleaseResourceLite(Fcb->Header.Resource);
74 
77 }
struct _EXT2_FCB * PEXT2_FCB
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
#define Ext2GetCurrentProcessName()
Definition: ext2fs.h:1452
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define CMCB_DEBUG_LEVEL
Definition: cmcb.c:20
smooth NULL
Definition: ftsmooth.c:416
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 DEBUG(args)
Definition: rdesktop.h:129
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FSRTL_CACHE_TOP_LEVEL_IRP
Definition: fsrtltypes.h:60
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

◆ Ext2ReleaseFromReadAhead()

VOID NTAPI Ext2ReleaseFromReadAhead ( IN PVOID  Context)

Definition at line 101 of file cmcb.c.

102 {
104 
105  ASSERT(Fcb != NULL);
106 
107  ASSERT((Fcb->Identifier.Type == EXT2FCB) &&
108  (Fcb->Identifier.Size == sizeof(EXT2_FCB)));
109 
110  DEBUG(CMCB_DEBUG_LEVEL, ("Ext2ReleaseFromReadAhead: i=%xh Fcb=%p\n",
111  Fcb->Mcb->Inode.i_ino, Fcb));
112 
114  ExReleaseResourceLite(Fcb->Header.Resource);
115 }
struct _EXT2_FCB * PEXT2_FCB
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
NTFSIDENTIFIER Identifier
Definition: ntfs.h:511
#define CMCB_DEBUG_LEVEL
Definition: cmcb.c:20
smooth NULL
Definition: ftsmooth.c:416
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
CD_MCB Mcb
Definition: cdstruc.h:1022
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
ULONG Type
Definition: ntfs.h:95
#define DEBUG(args)
Definition: rdesktop.h:129
_In_ PFCB Fcb
Definition: cdprocs.h:151
ULONG Size
Definition: ntfs.h:96

Referenced by DriverEntry().

Variable Documentation

◆ Ext2Global

PEXT2_GLOBAL Ext2Global

Definition at line 16 of file init.c.