In: Computer Science
In the Linux file system, the majority of the file
system code exists in the kernel. Discussion about the
effectiveness of this type of architecture, the reason, and support
on the same:
There is definitely "effectiveness" due to this type of Linux file
system architecture. This is effective in terms of security, to
function seamlessly, and to provide abstraction. Moreover, the
Linux kernel maintains the files in the file systems it supports.
Also, file systems are registered with the kernel.
The Linux file system interface has been implemented as a layered architecture, at different levels or layers in which the architecture separates the user interface layer, from the file system implementation, from the device drivers manipulating the storage devices. This majority of the file system code existing in the kernel gives a view from a perspective of the high-level architecture.
The kernel-space file system-related components that exist in the kernel space are System call interface, an Inode cache, a Virtual file system, a Directory cache, Individual file systems, a Buffer cache, and device drivers. However, the majority of the file system and the core components responsible for the same, existing in the kernel are the Inode cache, the virtual file system, the Directory cache, Individual file systems, and the Buffer cache.
The architecture has Linux Virtual File System (VFS) as the primary interface to the underlying file systems using which is how the Linux kernel's real file systems are supported. It even acts like the root level of the file-system interface. It thus keeps track of the currently-supported file systems and those currently mounted.
This VFS interface or component is responsible to export a set of interfaces and then abstract them to the individual file systems. The Linux kernel implements this VFS concept to separate actual "low-level" filesystem code from the rest of the kernel. The code, or the module, or a low-level file system, implement the handling of file systems of a given type. The low-level filesystem sits below the VFS like how low-level SCSI drivers sit below the higher SCSI layers. Also, registering a VFS is found in the code.
Linux supports many, separate, different file systems the system would use are not accessed by device identifiers, for example, a drive number or a drive name, rather are combined into a single hierarchical tree structure representing the file system as a single entity. Linux adds every file system into this single file system tree as and when they are mounted.
However, there exist other major user-space file systems with their own file system-related components such as user applications and GNU C Library in user-space.
When the kernel source code package is installed, the entire Linux kernel source code and its files are found here.