next up previous contents
Next: Mounting a File System Up: The Virtual File System Previous: The VFS Inode

Registering the File Systems

   figure8841
Figure: Registered File Systems

    When you build the Linux kernel you are asked if you want each of the supported file systems. When the kernel is built, the file system startup code contains calls to the initialisation routines of all of the built in file systems.

Linux file systems may also be built as modules and, in this case, they may be demand loaded as they are needed or loaded by hand using insmod . Whenever a file system module is loaded it registers itself with the kernel and unregisters itself when it is unloaded. Each file system's initialisation routine registers itself with the Virtual File System and is represented by a file_system_type  data structure which contains the name of the file system and a pointer to its VFS superblock read routine. Figure gif shows that the file_system_type  data structures are put into a list pointed at by the file_systems  pointer. Each file_system_type  data structure contains the following information:

Superblock read routine
This routine is called by the VFS when an instance of the file system is mounted,
File System name
The name of this file system, for example ext2,
Device needed
Does this file system need a device to support? Not all file system need a device to hold them. The /proc file system, for example, does not require a block device,

You can see which file systems are registered by looking in at /proc/filesystems. For example:
      ext2
nodev proc
      iso9660



David A. Rusling
david.rusling@reo.mts.dec.com