Solution Through Indirection: The Inode Map
Explore how the inode map provides a level of indirection between inode numbers and their disk locations in log-structured file systems. Understand how this approach helps increase efficiency by grouping inode updates with data blocks, enabling faster disk writes and recovery after crashes. Learn to balance the power of indirection with its potential overhead for better file system design.
We'll cover the following...
Inode map (imap)
To remedy the problem of finding inodes, the designers of LFS introduced a level of indirection between inode numbers and the inodes through a data structure called the inode map (imap). The imap is a structure that takes an inode number as input and produces the disk address of the most recent version of the inode. Thus, you can imagine it would often be implemented as a simple array, with 4 bytes (a disk pointer) per entry. Any time an inode is written to disk, the imap is updated with its new location.
The imap, unfortunately, needs to be kept persistent (i.e., written to disk); doing so allows LFS to keep track of the locations of inodes across crashes, and thus operate as desired. Thus, a question: where should the imap reside on disk?
It could live on a fixed part of the disk, of course. ...