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

Function Ext2RemoveMcbExtent

Ext4Fsd/memory.c:845–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845BOOLEAN
846Ext2RemoveMcbExtent (
847 IN PEXT2_VCB Vcb,
848 IN PEXT2_MCB Mcb,
849 IN LONGLONG Vbn,
850 IN LONGLONG Length
851)
852{
853 ULONG TriedTimes = 0;
854 LONGLONG Base = 0;
855 UCHAR Bits = 0;
856 BOOLEAN rc = TRUE;
857
858 Base = (LONGLONG)BLOCK_SIZE;
859 Bits = (UCHAR)BLOCK_BITS;
860
861 ASSERT ((Vbn & (Base - 1)) == 0);
862 ASSERT ((Length & (Base - 1)) == 0);
863
864 Vbn = (Vbn >> Bits) + 1;
865 Length = (Length >> Bits);
866
867Again:
868
869 __try {
870 FsRtlRemoveLargeMcbEntry(
871 &Mcb->Extents,
872 Vbn,
873 Length
874 );
875 } __except (EXCEPTION_EXECUTE_HANDLER) {
876 DbgBreak();
877 rc = FALSE;
878 }
879
880 if (!rc && ++TriedTimes < 10) {
881 Ext2Sleep(TriedTimes * 100);
882 goto Again;
883 }
884
885 DEBUG(DL_EXT, ("Ext2RemoveMcbExtent: Vbn=%I64xh Length=%I64xh Runs=%u\n",
886 Vbn, Length, FsRtlNumberOfRunsInLargeMcb(&Mcb->Extents)));
887 if (rc) {
888 Ext2CheckExtent(&Mcb->Extents, Vbn, 0, Length, FALSE);
889 }
890
891 return rc;
892}
893
894BOOLEAN
895Ext2LookupMcbExtent (

Callers 1

Ext2RemoveBlockExtentFunction · 0.85

Calls 2

Ext2SleepFunction · 0.85
Ext2CheckExtentFunction · 0.85

Tested by

no test coverage detected