Deep understanding of the Linux kernel-virtual file system

Source: Internet
Author: User

One of the keys to Linux's success is its ability to coexist harmoniously with other operating systems.

5 Standard File types:
1. Common documents
2. Catalog files
3. Symbolic Link File
4. Equipment files
5. Pipeline File

Virtual file system (Vsan FileSystem): The kernel software layer that handles all system calls related to the UNIX standard file system. Robustness tables can now provide a common interface for various file systems.

The VFS supported file systems can be divided into three main types:
1. Disk File system:
A, Linux used Ext2, EXT3, and Reiser file System (ReiserFS);
B, Unix family file systems such as the SysV file system (System V, coherent, Xenix), UFS (BSD, SOlaris, NEXTSTEP), Minix file system and VERITAS VxFS (SCO unixware)
C, window file system, such as Ms-dos,vfat,ntfs
d, DVD file system for ISO9660 CD-ROM file system and Universal Disk format (UDF)
E. Other proprietary file systems, such as HPFS (IBM's OS/2), HFS (Apple's Macintosh), Affs, ADFS
F, other log file systems originating from non-Linux systems, such as IBM JFS, SGI, XFS
2. Network File system
These file systems allow easy access to files contained in file systems belonging to other networked computers. Some of the well-known network file systems supported by the virtual file system are: NFS, Coda, AFS, CIFS (Common network File system for Windows), and NCP
3. Special File system
These file systems do not manage local or remote disk space. The/proc file system is a model for special file systems.

Generic file Model:
1. Capable of representing all supported file systems
2, in order to realize each specific file system, it must transform its physical organization structure into the universal file model of the virtual file system.

file allocation table (Files Allocation table,fat): directory-based file system

Read file:
When we call the Read function, the kernel invokes the corresponding Sys_read () service routine, which in Sys_read () is represented by a structure file structure that contains a F_OP field that contains a method for reading various file systems
For example: File->f_op->read (), for different file systems, read by different read methods

Disk cache: A software mechanism that allows the kernel to keep some of the information that existed on the disk in RAM so that further access to the data can be done quickly without having to slow access to the disk.
A, directory entry cache
B, index node cache
C, page cache

Hardware cache: is a fast static RAM that accelerates requests to slow dynamic RAM directly.

Memory cache: is a software mechanism that is introduced to bypass the kernel memory allocator (see Slab allocator)


File system registration: A file system needs to be able to be used to register his type in a one-way list.

Linux root file system: The kernel is installed directly in the boot phase and has the system initialization script and the most basic system program.

Mount point: The directory where the file system is installed.

Process namespace: Each process can have its own installed file system tree.

File system Installation:
1, most Unix-like kernel, each file system can only be installed once, for example, the ext2 file system stored on the/DEV/FD0 floppy disk is installed in/FLP by command (mount-t EXT2/DEV/FD0/FLP)
All installation commands acting on/dev/fd0 will be invalidated before being uninstalled via Umount.
2, Linux different, the same file system can be installed multiple times.
3, no matter how many times a file system is installed, it has only one super Block object.
4, the same installation point can install multiple file systems
5, after the installation will be hidden first installed, when top layer top installation is removed, the following system has become available

File System uninstallation: Umount ()

Path name lookup:
1. If the path starts with ' \ ', it is the absolute path, starting from Current->fs->root search
2, otherwise is a relative path, starting from Current->fs->pwd search

Standard path name lookup:

Parent path name Lookup:

Search for Symbolic Links: you need to pay attention to circular references and use counters to solve them.

File Lock:

Linux file Lock:

Fl_flock Lock and Fl_posix Lock:









Deep understanding of the Linux kernel-virtual 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.