Linux2.6 -- Virtual File System

Source: Internet
Author: User

A Virtual File System (also known as virtual file exchange (VFS), as a kernel subsystem, provides interfaces related to files and file systems for user space programs. all file systems in the system depend not only on the coexistence of VFS, but also on the Coordination of VFS systems. through the Virtual File System, the program can use standard UNIX system calls to perform read and write operations on different file systems, or even file systems on different media, as follows:

The figure indicates:

Action executed by VFS: Use the CP (1) command to copy data from the hard disk in the ext3 file system format to the removable disk in the ext2 file system format. two different file systems and two different media are connected to the same VFS.

VFS allows you to directly use system calls such as open (), read (), and write () without considering the specific file system and the actual physical media, these can be called the abstract layer of the file system. There is a virtual file system on top of the file system. Using VFS to implement the corresponding method can shield the differences between different file systems, the common interface is provided to the user so that the user does not feel the differences between different file systems. The following figure shows the collaboration between various systems when the user operates write:

Meaning: write () calls data streams from the user space, first through the general system call of VFS, second through the special writing of the file system, and finally written into the physical media

VFS defines some data structures and adds general methods to execute these structures, and finally allows different file systems to implement their own methods to shield the differences between different file systems:

VFS has four main object types:

Super block object, which represents a specific installed File System

Index Node object, which represents a specific file

Directory item object, which represents a directory item and is an integral part of the path

File object, which represents the file opened by the Process

Linux supports many types of file systems. from local file systems (such as ext3 and ext4) to network file systems (such as NFS), Linux supports more than 60 file systems in the standard kernel. the VFS layer provides a unified framework for these different file systems, and provides a unified interface that can call interaction with the standard system. because of the existence of the VFS layer, it makes it easy to implement the new file system on Linux, which can easily make these file systems work together through standard Unix system calls.

Recommended reading:

Common commands for Linux file systems and file operations

Linux File System limits ulimit usage

Detailed explanation of file time attribute in Linux File System

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.