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

Function Ext2Cleanup

Ext4Fsd/cleanup.c:20–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18/* DEFINITIONS *************************************************************/
19
20NTSTATUS
21Ext2Cleanup (IN PEXT2_IRP_CONTEXT IrpContext)
22{
23 PDEVICE_OBJECT DeviceObject;
24 NTSTATUS Status = STATUS_SUCCESS;
25 PEXT2_VCB Vcb = NULL;
26 PFILE_OBJECT FileObject;
27 PEXT2_FCB Fcb = NULL;
28 PEXT2_CCB Ccb = NULL;
29 PIRP Irp = NULL;
30 PEXT2_MCB Mcb = NULL;
31
32
33 BOOLEAN VcbResourceAcquired = FALSE;
34 BOOLEAN FcbResourceAcquired = FALSE;
35 BOOLEAN FcbPagingIoResourceAcquired = FALSE;
36 BOOLEAN SymLinkDelete = FALSE;
37
38 __try {
39
40 ASSERT(IrpContext != NULL);
41 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
42 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
43
44 DeviceObject = IrpContext->DeviceObject;
45 if (IsExt2FsDevice(DeviceObject)) {
46 Status = STATUS_SUCCESS;
47 __leave;
48 }
49
50 Irp = IrpContext->Irp;
51 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
52 ASSERT(Vcb != NULL);
53 ASSERT((Vcb->Identifier.Type == EXT2VCB) &&
54 (Vcb->Identifier.Size == sizeof(EXT2_VCB)));
55
56 if (!IsVcbInited(Vcb)) {
57 Status = STATUS_SUCCESS;
58 __leave;
59 }
60
61 FileObject = IrpContext->FileObject;
62 Fcb = (PEXT2_FCB) FileObject->FsContext;
63 if (!Fcb || (Fcb->Identifier.Type != EXT2VCB &&
64 Fcb->Identifier.Type != EXT2FCB)) {
65 Status = STATUS_SUCCESS;
66 __leave;
67 }
68 Mcb = Fcb->Mcb;
69 Ccb = (PEXT2_CCB) FileObject->FsContext2;
70
71 if (IsFlagOn(FileObject->Flags, FO_CLEANUP_COMPLETE)) {
72 Status = STATUS_SUCCESS;
73 __leave;
74 }
75
76 if (Fcb->Identifier.Type == EXT2VCB) {
77

Callers 1

Ext2DispatchRequestFunction · 0.85

Calls 12

Ext2ClearVpbFlagFunction · 0.85
Ext2FlushFileFunction · 0.85
ext3_release_dirFunction · 0.85
Ext2LinuxTimeFunction · 0.85
Ext2NtTimeFunction · 0.85
Ext2SaveInodeFunction · 0.85
Ext2NotifyReportChangeFunction · 0.85
Ext2IsFastIoPossibleFunction · 0.85
Ext2TruncateFileFunction · 0.85
Ext2DeleteFileFunction · 0.85
Ext2QueueRequestFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected