O'Reilly logo

Understanding the Linux Kernel, 3rd Edition by Marco Cesati, Daniel P. Bovet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

dev_t

s_dev

Device identifier

unsigned long

s_blocksize

Block size in bytes

unsigned long

s_old_blocksize

Block size in bytes as reported by the underlying block device driver

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 handling methods

struct quotactl_ops *

s_qcop

Disk quota administration methods

struct export_operations *

s_export_op

Export operations used by network filesystems

unsigned long

s_flags

Mount flags

unsigned long

s_magic

Filesystem magic number

struct dentry *

s_root

Dentry object of the filesystem's root directory

struct rw_semaphore

s_umount

Semaphore used for unmounting

struct semaphore

s_lock ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required