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

Function Ext2LookupMcbExtent

Ext4Fsd/memory.c:894–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894BOOLEAN
895Ext2LookupMcbExtent (
896 IN PEXT2_VCB Vcb,
897 IN PEXT2_MCB Mcb,
898 IN LONGLONG Vbn,
899 OUT PLONGLONG Lbn,
900 OUT PLONGLONG Length
901)
902{
903 LONGLONG offset;
904 BOOLEAN rc;
905
906 offset = Vbn & (~((LONGLONG)BLOCK_SIZE - 1));
907 ASSERT ((offset & (BLOCK_SIZE - 1)) == 0);
908 offset = (offset >> BLOCK_BITS) + 1;
909
910 rc = FsRtlLookupLargeMcbEntry(
911 &(Mcb->Extents),
912 offset,
913 Lbn,
914 Length,
915 NULL,
916 NULL,
917 NULL
918 );
919
920 if (rc) {
921
922 if (Lbn && ((*Lbn) != -1)) {
923 ASSERT((*Lbn) > 0);
924 (*Lbn) = (((*Lbn) - 1) << BLOCK_BITS);
925 (*Lbn) += ((Vbn) & ((LONGLONG)BLOCK_SIZE - 1));
926 }
927
928 if (Length && *Length) {
929 (*Length) <<= BLOCK_BITS;
930 (*Length) -= ((Vbn) & ((LONGLONG)BLOCK_SIZE - 1));
931 }
932 }
933
934 return rc;
935}
936
937
938BOOLEAN

Callers 1

Ext2LookupBlockExtentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected