ext2: Use a more generic cache index
diff --git a/src/filo-fs-ext2.ads b/src/filo-fs-ext2.ads
index 96bd102..90c1ae6 100644
--- a/src/filo-fs-ext2.ads
+++ b/src/filo-fs-ext2.ads
@@ -50,15 +50,13 @@
type FSBlock_Offset is new Block_Offset range 0 .. Block_Offset'Last / 2;
type FSBlock_Logical is new Block_Offset range 0 .. Block_Offset'Last / 2;
- -- We use a 64KiB cache.
- -- * If that's the block size, only the `Any` entry is used.
- -- * For a 32KiB block size, `Any` and `Last_Level` (for indirect block
- -- lookups) are used.
- -- * For smaller block sizes, the most common case, we cache four blocks.
- -- For the `Any` entry, we note the logical block address (block offset
- -- within a file). For the indirect entries, we note the *first* logical
- -- block that they map.
- type Block_Cache_Index is (Any, Last_Level, Second_Last_Level, First_Level);
+ -- We use a 64KiB cache which fits at least one ext2 block. If a lower
+ -- block size is encountered (likely), we partition the cache into up
+ -- to 64 1KiB blocks.
+ -- Cache entries can be used for blocks that map logical block offets
+ -- to physical ones. Then we note the first logical block offset mapped
+ -- by the cached block.
+ 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;