In linux, mount tree structure and traversal-Linux general technology-Linux programming and kernel information. The following is a detailed description. In linux, The vfsmount structure record is mounted to the file system. Its data member mnt_parent points to the parent File System of the file system, mnt_mounts is the head of the Child file system chain, mnt_child points to the sibling Node
For example, the system's root file system is in the ext3 format, mount three partitions in the/mnt/winc/mnt/wind/mnt/wine directory (which can be considered as a c d e disk in windows ). In this way, the system allocates a vfsmount structure for the three newly mounted file systems, points the mnt_parent to the vfsmount structure of the root file system, and links it to the mnt_mounts linked list of the file system vfsmount through mnt_child, initialize mnt_mounts to point to itself.
In the kernel code, the first root traversal algorithm is used to traverse the mount tree with a specific vfsmount as the root:
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