"Linux Kernel Design and Implementation" Reading Notes-Virtual File System

Virtual file system

The virtual file system provides file and file system-related interfaces for user space programs .

VFS provides a common file system model.

The actual file system provides the abstract interface and data structure expected by the VFS through programming.

 

VFS object and its data structure

Four main objects after VFS:

Super block object : contains file system information;

Index node object : contains relevant information about a specific file;

Directory item object : contains directory item information, which is a component of the path; (note that this is a directory item object, not a directory object)

File object : contains the file information opened by the process;

Each main object contains an operation object:

super_operations object : contains methods that can be called for a specific file system;

inode_operations object : contains methods that can be called for a specific file;

Dentry_operations object : contains the methods that can be called for a specific directory;

file_operations object : contains the methods that can be called for the opened file;

 

File system related data objects

file_system_type is used to describe a specific file system type, such as ext3, ext4, etc.

vfsmount is used to describe an instance of mounting a file system.

 

Process-related data structure

The file_struct is pointed to by the files member in the process description, and all the information related to a single process (such as open files and file descriptors) are included in it.

The fs_struct is pointed to by the fs member in the process description and contains information about the file system and the process.

The namespace structure is pointed to by the mmt_namespace member in the process descriptor.

 

Guess you like

Origin blog.csdn.net/jiangwei0512/article/details/106150959