Tune ext2 types
diff --git a/src/filo-fs-ext2.adb b/src/filo-fs-ext2.adb
index 7cf6147..21cfe0c 100644
--- a/src/filo-fs-ext2.adb
+++ b/src/filo-fs-ext2.adb
@@ -56,7 +56,7 @@
end if;
State.Part_Len := Part_Len;
- State.First_Data_Block := Block_Offset (Read_LE32 (Super_Block, 5 * 4));
+ State.First_Data_Block := FSBlock_Offset (Read_LE32 (Super_Block, 5 * 4));
declare
S_Log_Block_Size : constant Unsigned_32 := Read_LE32 (Super_Block, 6 * 4);
@@ -110,8 +110,9 @@
declare
S_Desc_Size : constant Unsigned_16 := Read_LE16 (Super_Block, 63 * 4 + 2);
begin
- if S_Desc_Size in
- Unsigned_16 (Desc_Size'First) .. Unsigned_16 (Desc_Size'Last)
+ if Is_Power_Of_2 (S_Desc_Size) and then
+ S_Desc_Size in Unsigned_16 (Desc_Size'First) ..
+ Unsigned_16 (Positive'Min (Desc_Size'Last, 2 ** State.Block_Size_Bits))
then
State.Desc_Size := Desc_Size (S_Desc_Size);
else