MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2FloppyFlush

Function Ext2FloppyFlush

Ext4Fsd/write.c:62–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60/* FUNCTIONS *************************************************************/
61
62VOID
63Ext2FloppyFlush(IN PVOID Parameter)
64{
65 PEXT2_FLPFLUSH_CONTEXT Context;
66 PFILE_OBJECT FileObject;
67 PEXT2_FCB Fcb;
68 PEXT2_VCB Vcb;
69
70 Context = (PEXT2_FLPFLUSH_CONTEXT) Parameter;
71 FileObject = Context->FileObject;
72 Fcb = Context->Fcb;
73 Vcb = Context->Vcb;
74
75 DEBUG(DL_FLP, ("Ext2FloppyFlushing ...\n"));
76
77 IoSetTopLevelIrp((PIRP)FSRTL_FSP_TOP_LEVEL_IRP);
78
79 if (FileObject) {
80 ASSERT(Fcb == (PEXT2_FCB)FileObject->FsContext);
81 ExAcquireResourceExclusiveLite(&Fcb->MainResource, TRUE);
82 ExAcquireSharedStarveExclusive(&Fcb->PagingIoResource, TRUE);
83 ExReleaseResourceLite(&Fcb->PagingIoResource);
84
85 CcFlushCache(&(Fcb->SectionObject), NULL, 0, NULL);
86 ExReleaseResourceLite(&Fcb->MainResource);
87
88 ObDereferenceObject(FileObject);
89 }
90
91 if (Vcb) {
92 ExAcquireResourceExclusiveLite(&Vcb->MainResource, TRUE);
93
94 ExAcquireSharedStarveExclusive(&Vcb->PagingIoResource, TRUE);
95 ExReleaseResourceLite(&Vcb->PagingIoResource);
96
97 Ext2FlushVcb(Vcb);
98 ExReleaseResourceLite(&Vcb->MainResource);
99 }
100
101 IoSetTopLevelIrp(NULL);
102 Ext2FreePool(Parameter, EXT2_FLPFLUSH_MAGIC);
103}
104
105VOID
106Ext2FloppyFlushDpc (

Callers

nothing calls this directly

Calls 2

Ext2FlushVcbFunction · 0.85
Ext2FreePoolFunction · 0.85

Tested by

no test coverage detected