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

Function Ext2LookupBlockExtent

Ext4Fsd/memory.c:1058–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056
1057
1058BOOLEAN
1059Ext2LookupBlockExtent(
1060 IN PEXT2_VCB Vcb,
1061 IN PEXT2_MCB Mcb,
1062 IN ULONG Start,
1063 IN PULONG Block,
1064 IN PULONG Mapped
1065)
1066{
1067 LONGLONG Vbn = 0;
1068 LONGLONG Lbn = 0;
1069 LONGLONG Length = 0;
1070
1071 BOOLEAN rc = FALSE;
1072
1073 Vbn = ((LONGLONG) Start) << BLOCK_BITS;
1074
1075 if (Mcb) {
1076 rc = Ext2LookupMcbExtent(Vcb, Mcb, Vbn, &Lbn, &Length);
1077 } else {
1078 rc = Ext2LookupVcbExtent(Vcb, Vbn, &Lbn, &Length);
1079 }
1080
1081 if (rc) {
1082 *Mapped = (ULONG)(Length >> BLOCK_BITS);
1083 if (Lbn != -1 && Length > 0) {
1084 *Block = (ULONG)(Lbn >> BLOCK_BITS);
1085 } else {
1086 *Block = 0;
1087 }
1088 }
1089
1090 return rc;
1091}
1092
1093
1094BOOLEAN

Callers 2

Ext2AddBlockExtentFunction · 0.85
Ext2BuildExtentsFunction · 0.85

Calls 2

Ext2LookupMcbExtentFunction · 0.85
Ext2LookupVcbExtentFunction · 0.85

Tested by

no test coverage detected