VFS (linux virtual file system)

VFS consists of the following object model:

1. Super block object:

Holds information about the mounted filesystem. For disk-based filesystems, this type of object usually corresponds to the filesystem control block stored on disk.

All superblock objects are linked together in the form of a doubly circular linked list, and each node has a spin lock to prevent this linked list from being accessed simultaneously on multiprocessor systems.

It is created when various specific file systems are installed and automatically deleted when uninstalled. linux has a super fast equivalent in memory for each mounted filesystem

2, the index node object:

General information about a specific file is stored, and all the information the file system needs to process the file is placed in a data structure called an inode.

The file name can be modified at any time, but the inode is unique to the file and exists with the existence of the file.

An in-memory inode object consists of an inode data structure.

3. File object:

Stores the information about the interaction between the open file and the process. The file object is created when the file is opened and consists of a file structure.

The file object does not have an image on the disk, it is just a data structure established in response to the needs of the kernel, so the file does not have a "dirty" field and does not need to be synchronized with the disk.

The main information stored in the file object is the file pointer.

4. Directory item information, which stores the information about linking the directory item to the corresponding file.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325529065&siteId=291194637