ext2: Rename Inode.Extents => Inode.Inline
diff --git a/src/filo-fs-ext2.adb b/src/filo-fs-ext2.adb
index 00a5985..cb3f7bf 100644
--- a/src/filo-fs-ext2.adb
+++ b/src/filo-fs-ext2.adb
@@ -231,7 +231,7 @@
with Size => Inode_Extents'Length * 8;
function I_Blocks is new Ada.Unchecked_Conversion (Inode_Extents, Inode_Blocks);
- function I_Blocks (State : T) return Inode_Blocks is (I_Blocks (State.Inode.Extents));
+ function I_Blocks (State : T) return Inode_Blocks is (I_Blocks (State.Inode.Inline));
Block_Size : constant Natural := 2 ** State.Block_Size_Bits;
Addr_Per_Block : constant FSBlock_Logical := FSBlock_Logical (Block_Size / 4);
@@ -511,10 +511,11 @@
end;
end Next_Ref;
- Inode_Magic : constant Unsigned_16 := Header_Magic (State.Inode.Extents);
- Inode_Entries : constant Natural := Header_Entries (State.Inode.Extents);
- First_Logical : constant FSBlock_Logical := Extent_Logical (State.Inode.Extents, 1);
- Depth : Natural := Header_Depth (State.Inode.Extents);
+ Inline_Extents : Ext2.Inode_Extents renames State.Inode.Inline;
+ Inode_Magic : constant Unsigned_16 := Header_Magic (Inline_Extents);
+ Inode_Entries : constant Natural := Header_Entries (Inline_Extents);
+ First_Logical : constant FSBlock_Logical := Extent_Logical (Inline_Extents, 1);
+ Depth : Natural := Header_Depth (Inline_Extents);
Cache_Start, Cache_End : Max_Block_Index;
Logical_Off, Length : FSBlock_Logical;
@@ -523,21 +524,21 @@
Success :=
Inode_Magic = Extent_Header_Magic and then
Inode_Entries > 0 and then
- Inode_Entries < State.Inode.Extents'Length / Extent_Header_Size and then
+ Inode_Entries < Inline_Extents'Length / Extent_Header_Size and then
First_Logical <= Logical;
if not Success then
Physical := 0;
return;
end if;
- Idx := Bin_Search (State.Inode.Extents, Inode_Entries);
+ Idx := Bin_Search (Inline_Extents, Inode_Entries);
if Depth = 0 then
- Physical := Extent_Physical (State.Inode.Extents, Idx);
- Logical_Off := Extent_Logical (State.Inode.Extents, Idx);
- Length := Extent_Length (State.Inode.Extents, Idx);
+ Physical := Extent_Physical (Inline_Extents, Idx);
+ Logical_Off := Extent_Logical (Inline_Extents, Idx);
+ Length := Extent_Length (Inline_Extents, Idx);
else
- Physical := Index_Physical (State.Inode.Extents, Idx);
- Logical_Off := Index_Logical (State.Inode.Extents, Idx);
+ Physical := Index_Physical (Inline_Extents, Idx);
+ Logical_Off := Index_Logical (Inline_Extents, Idx);
loop
Depth := Depth - 1;
Next_Ref
@@ -655,7 +656,7 @@
Inode_Flags (State.Block_Cache (Cache_Start .. Cache_End), Inode_In_Block);
begin
State.Inode.Use_Extents := State.Feature_Extents and (I_Flags and EXT4_EXTENTS_FL) /= 0;
- State.Inode.Extents := State.Block_Cache (Cache_Start + 40 .. Cache_Start + 100 - 1);
+ State.Inode.Inline := State.Block_Cache (Cache_Start + 40 .. Cache_Start + 100 - 1);
Reset_Cache_Logical (State);
State.S := File_Opened;
end;