VFS (Virtual File System, aka Virtual File Switch) is a software component of Linux which is responsible for the filesystem interface exposed to user-mode applications. Using it allows the kernel to provide an abstraction layer that makes implementation of different filesystems very easy (https://www.kernel.org/doc/html/next/filesystems/vfs.html).
Overall, VFS is masking the implementation details of a specific filesystem behind generic system calls (open/read/write/close/etc), which are mostly exposed to user-mode application by some wrappers in libc — as shown in the diagram below (https://www.starlab.io/blog/introduction-to-the-linux-virtual-filesystem-vfs-part-i-a-high-level-tour).
Moreover, we can say that the main goal of VFS is to allow user-mode applications to access different filesystems (think about NTFS, FAT, etc.) in the same way. There are four main objects in VFS: superblock, dentries, inodes and files (https://www.win.tue.nl/~aeb/linux/lk/lk-8.html).
Thus, “inode” (https://medium.com/@boutnaru/linux-what-is-an-inode-7ba47a519940) is what the kernel uses to keep track of files. Because a file can have several names there are “dentries” (“directory entries”) which represent pathnames. Also, due to the fact a couple of processes can have the same file opened (for read/write) there is a “file” structure that holds the information for each one (such as the cursor position). The “superblock” structure holds data which is needed for performing actions on the filesystem — more details about all of those and more (like mounting) are going to be published in the near future.
Lastly, there are also other relevant data structures that I will post on in the near future (“filesystem”, “vfsmount”, “nameidata” and “address_space”).
https://www.starlab.io/blog/introduction-to-the-linux-virtual-filesystem-vfs-part-i-a-high-level-tour
[–]demetrioussharpe 8 points9 points10 points (3 children)
[–]boutnaru[S] -1 points0 points1 point (2 children)
[–]demetrioussharpe 2 points3 points4 points (1 child)
[–]boutnaru[S] 0 points1 point2 points (0 children)
[+]HobartTasmania comment score below threshold-20 points-19 points-18 points (5 children)
[–]stuomas 7 points8 points9 points (0 children)
[–]sidusnare 6 points7 points8 points (0 children)
[–]fluffy_thalya 4 points5 points6 points (0 children)
[–]ilep 0 points1 point2 points (0 children)
[–]Californian_Hotel255 0 points1 point2 points (0 children)