O'Reilly logo

Understanding the Linux Kernel by Marco Cesati, Daniel P. Bovet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.3. Filesystem Mounting

Now we'll focus on how the VFS keeps track of the filesystems it is supposed to support. Two basic operations must be performed before making use of a filesystem: registration and mounting.

Registration is done either when the system boots or when the module implementing the filesystem is being loaded. Once a filesystem has been registered, its specific functions are available to the kernel, so that kind of filesystem can be mounted on the system's directory tree.

Each filesystem has its own root directory. The filesystem whose root directory is the root of the system's directory tree is called root filesystem. Other filesystems can be mounted on the system's directory tree: the directories on which they are inserted are called mount points.

12.3.1. Filesystem Registration

Often, the user configures Linux to recognize all the filesystems needed when compiling the kernel for her system. But the code for a filesystem actually may either be included in the kernel image or dynamically loaded as a module (see Appendix B). The VFS must keep track of all filesystems whose code is currently included in the kernel. It does this by performing filesystem registrations.

Each registered filesystem is represented as a file_system_type object whose fields are illustrated in Table 12-7. All filesystem-type objects are inserted into a simply linked list. The file_systems variable points to the first item.

Table 12-7. The Fields of the file_system_type Object
Type

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required