Many of the VFS methods described in Chapter 12 have a corresponding Ext2 implementation. Since it would take a whole book to describe all of them, we limit ourselves to briefly reviewing the methods implemented in Ext2. Once the disk and the memory data structures are clearly understood, the reader should be able to follow the code of the Ext2 functions that implement them.
Many VFS superblock operations have
a specific implementation in Ext2, namely
addresses of the superblock methods are stored into the
ext2_sops array of pointers.
Some of the VFS inode operations have a specific implementation in Ext2, which depends on the type of the file to which the inode refers.
If the inode refers to a regular file, all inode operations listed in
ext2_file_inode_operations table have a
NULL pointer, except for the
truncate operation that is implemented by the
ext2_truncate( ) function. Recall that the VFS
uses its own generic functions when the corresponding Ext2 method is
If the inode refers to a directory, most inode operations listed in
ext2_dir_inode_operations table are
implemented by specific Ext2 functions (see Table 17-8).
Table 17-8. Ext2 inode operations for directory files
VFS inode operation
Ext2 directory inode method