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.

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_dirt

Modified (dirty) flag

unsigned long long

s_maxbytes

Maximum size of the files

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

struct dentry *

s_root

Dentry object of mount directory

struct rw_semaphore

s_umount

Semaphore used for unmounting

struct semaphore

s_lock

Superblock semaphore

int

s_count

Reference counter

atomic_t

s_active

Secondary reference counter

struct list_head

s_dirty

List of modified inodes

struct list_head ...

Get Understanding the Linux Kernel, Second Edition 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.