ext2: Better organize per inode info
diff --git a/src/filo-fs-ext2.ads b/src/filo-fs-ext2.ads
index 63f817e..b1f1544 100644
--- a/src/filo-fs-ext2.ads
+++ b/src/filo-fs-ext2.ads
@@ -59,15 +59,17 @@
subtype Block_Cache_Index is Natural range 0 .. 63;
type Block_Cache_Type is array (Block_Cache_Index) of FSBlock_Logical;
- Direct_Blocks : constant := 12;
- type Direct_Blocks_Array is array (Natural range 0 .. Direct_Blocks - 1) of Unsigned_32;
-
-- Same as the 12 direct + 3 indirect blocks times 4B:
subtype Inode_Extents_Index is Natural range 0 .. 59;
+ subtype Inode_Extents is Buffer_Type (Inode_Extents_Index);
subtype Inode_Size is Positive range 128 .. Positive (Unsigned_16'Last);
subtype Desc_Size is Positive range 32 .. 2 ** 15; -- power-of-2 that fits in 16 bits
+ type Inode_Info is record
+ Extents : Buffer_Type (Inode_Extents_Index) := (others => 16#00#);
+ end record;
+
type T is record
S : State;
Part_Len : Partition_Length := 0;
@@ -78,11 +80,7 @@
Desc_Size : Ext2.Desc_Size := Ext2.Desc_Size'First;
Feature_Extents : Boolean := False;
Feature_64Bit : Boolean := False;
- Direct_Blocks : Direct_Blocks_Array := (others => 0);
- Indirect_Block : Unsigned_32 := 0;
- Double_Indirect : Unsigned_32 := 0;
- Triple_Indirect : Unsigned_32 := 0;
- Inode_Extents : Buffer_Type (Inode_Extents_Index) := (others => 16#00#);
+ Inode : Inode_Info := (others => <>);
Block_Cache_Index : Block_Cache_Type := (others => 0);
Block_Cache : Buffer_Type (Max_Block_Index) := (others => 16#00#);
end record;