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

Function Ext2LookupVcbExtent

Ext4Fsd/memory.c:744–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742}
743
744BOOLEAN
745Ext2LookupVcbExtent (
746 IN PEXT2_VCB Vcb,
747 IN LONGLONG Vbn,
748 OUT PLONGLONG Lbn,
749 OUT PLONGLONG Length
750)
751{
752 LONGLONG offset;
753 BOOLEAN rc;
754
755 offset = Vbn & (~(Vcb->IoUnitSize - 1));
756 ASSERT ((offset & (Vcb->IoUnitSize - 1)) == 0);
757 offset = (offset >> Vcb->IoUnitBits) + 1;
758
759 rc = FsRtlLookupLargeMcbEntry(
760 &(Vcb->Extents),
761 offset,
762 Lbn,
763 Length,
764 NULL,
765 NULL,
766 NULL
767 );
768
769 if (rc) {
770
771 if (Lbn && ((*Lbn) != -1)) {
772 ASSERT((*Lbn) > 0);
773 (*Lbn) = (((*Lbn) - 1) << Vcb->IoUnitBits);
774 (*Lbn) += ((Vbn) & (Vcb->IoUnitSize - 1));
775 }
776
777 if (Length && *Length) {
778 (*Length) <<= Vcb->IoUnitBits;
779 (*Length) -= ((Vbn) & (Vcb->IoUnitSize - 1));
780 }
781 }
782
783 return rc;
784}
785
786
787BOOLEAN

Callers 2

Ext2LookupBlockExtentFunction · 0.85
Ext2WriteVolumeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected