Linux Kernel Architecture

(Jacob Rumans) #1

The Virtual Filesystem


Typically, a full Linux system consists of somewhere between several thousand and a few million
files that store programs, data, and all kinds of information. Hierarchical directory structures are
used to catalog and group files together. Various approaches are adopted to permanently store the
required structures and data.


Every operating system has at least one ‘‘standardfilesystem‘‘ that features functions, some good,
some less so, to carry out required tasks reliably and efficiently. The Second/Third Extended
Filesystem that comes with Linux is a kind of standard filesystem that has proved itself to be
very robust and suitable for everyday use over the past few years. Nevertheless, there are other
filesystems written for or ported to Linux, all of which are acceptable alternatives to the Ext2 stan-
dard. Of course, this does not mean that programmers must apply different file access methods for
each filesystem they use — this would run totally counter to the concept of an operating system as
an abstraction mechanism.


To support various native filesystems and, at the same time, to allow access to files of other oper-
ating systems, the Linux kernel includes a layer between user processes (or the standard library)
and the filesystem implementation. This layer is known as theVirtual File System,orVFSfor short.^1
Figure 8-1 shows the significance of the layer.


The task of VFS is not a simple one. On the one hand, it is intended to provide uniform ways of
manipulating files, directories, and other objects. On the other, it must be able to come to terms with
the concrete implementations of the various approaches, which differ in part not only in specific
details but also in their overall design. However, the rewards are high because VFS adds substantial
flexibility to the Linux kernel.


The kernel supports more than 40 filesystems of various origins — ranging from the FAT
filesystem from the MS-DOS era through UFS (BerkeleyUnix) and iso9660 for CD-ROMs to
network filesystems such as coda and NFS and virtual versions such asprocfs.


(^1) The termvirtual filesystem switchis also used occasionally.

Free download pdf