Linux Kernel Architecture

(Jacob Rumans) #1

Chapter 9: The Extended Filesystem Family


and can be removed. During normal operation, the contents of the journal play no active role. Only if a
system crash occurs are the journal data used to reconstruct changes to the filesystem and return it to a
consistent state.

As compared to the original definition in Ext2, several elements have been added to the superblock data
structure of Ext3 to support the journal functions:

<ext3_fs_sb.h>

struct ext3_sb_info {
...
/* Journaling */
struct inode * s_journal_inode;
struct journal_s * s_journal;
unsigned long s_commit_interval;
struct block_device *journal_bdev;
};

As noted, the journal can be held both in a file and on its own partition. Depending on the option chosen,
eithers_journal_inodeorjournal_bdevis used to reference its location.s_commit_intervalspecifies
the frequency with which data are transferred from memory into the journal, ands_journalpoints to
the journal data structure.

9.4 Summary


Filesystems are used to organize file data on physicalblock devices like hard disks to store information
persistently across reboots. The second and third extended filesystems have been the standard working
horses of Linux for many years, and you have seen their implementation and how they represent data on
disks in detail.

After describing the basic challenges that filesystems have to face, you have seen the on-disk and in-
kernel structures of the second extended file system. You have learned how filesystem objects are man-
aged by inodes, and how data blocks that provide storage space for files are handled. Various important
filesystem operations like creating new directories were also discussed in detail.

Finally, you have been introduced to the journaling mechanisms of Ext3, the evolutionary successor
of Ext2.
Free download pdf