12.2. VFS Data Structures

Each VFS object is stored in a suitable data structure, which includes both the object attributes and a pointer to a table of object methods. The kernel may dynamically modify the methods of the object, and hence it may install specialized behavior for the object. The following sections explain the VFS objects and their interrelationships in detail.

12.2.1. Superblock Objects

A superblock object consists of a super_block structure whose fields are described in Table 12-2.

Table 12-2. The Fields of the Superblock Object
Type Field Description
struct list_head s_list Pointers for superblock list
kdev_t s_dev Device identifier
unsigned long s_blocksize Block size in bytes
unsigned char s_blocksize_bits Block size in number of bits
unsigned char s_lock Lock flag
unsigned char s_rd_only Read-only flag
unsigned char s_dirt Modified (dirty) flag
struct file_system_type * s_type Filesystem type
struct super_operations * s_op Superblock methods
struct dquot_operations * dq_op Disk quota methods
unsigned long s_flags Mount flags
unsigned long s_magic Filesystem magic number
unsigned long s_time Time of last superblock change
struct dentry * s_root Dentry object of mount directory
struct wait_queue * s_wait Mount wait queue
struct inode * s_ibasket Future development
short int s_ibasket_count Future development
short int s_ibasket_max Future development
struct list_head s_dirty List of modified inodes
union u Specific filesystem information

All superblock objects ...

Get Understanding the Linux Kernel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.