LinuxFileSystem - Chapter 12 The Virtual Filesystem One of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 12. The Virtual Filesystem One of Linux's keys to success is its ability to coexist comfortably with other systems. You can transparently mount disks or partitions that host file formats used by Windows , other Unix systems, or even systems with tiny market shares like the Amiga. Linux manages to support multiple filesystem types in the same way other Unix variants do, through a concept called the Virtual Filesystem. The idea behind the Virtual Filesystem is to put a wide range of information in the kernel to represent many different types of filesystems ; there is a field or function to support each operation provided by all real filesystems supported by Linux. For each read, write, or other function called, the kernel substitutes the actual function that supports a native Linux filesystem, the NTFS filesystem, or whatever other filesystem the file is on. This chapter discusses the aims, structure, and implementation of Linux's Virtual Filesystem. It focuses on three of the five standard Unix file typesnamely, regular files, directories, and symbolic links. Device files are covered in Chapter 13 , while pipes are discussed in Chapter 19 . To show how a real filesystem works, Chapter 18 covers the Second Extended Filesystem that appears on nearly all Linux systems. 12.1. The Role of the Virtual Filesystem (VFS) The Virtual Filesystem (also known as Virtual Filesystem Switch or VFS ) is a kernel software layer that handles all system calls related to a standard Unix filesystem. Its main strength is providing a common interface to several kinds of filesystems. For instance, let's assume that a user issues the shell command: $ cp /floppy/TEST /tmp/test where /floppy is the mount point of an MS-DOS diskette and /tmp is a normal Second Extended Filesystem (Ext2) directory. The VFS is an abstraction layer between the application program and the filesystem implementations (see Figure 12- 1 (a)). Therefore, the cp program is not required to know the filesystem types of /floppy/TEST and /tmp/test . Instead, cp interacts with the VFS by means of generic system calls known to anyone who has done Unix programming (see the section " File-Handling System Calls " in Chapter 1 ); the code executed by cp is shown in Figure 12-1 (b). Figure 12-1. VFS role in a simple file copy operation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Filesystems supported by the VFS may be grouped into three main classes: Disk-based filesystems These manage memory space available in a local disk or in some other device that emulates a disk (such as a USB flash drive). Some of the well-known disk-based filesystems supported by the VFS are: Filesystems for Linux such as the widely used Second Extended Filesystem (Ext2), the recent Third Extended Filesystem (Ext3), and the Reiser Filesystems (ReiserFS ) [*] [*] Although these filesystems owe their birth to Linux, they have been ported to several other operating systems. Filesystems for Unix variants such as sysv filesystem (System V ,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2012 for the course CMP 426 taught by Professor Gwangs.jung during the Spring '12 term at CUNY Lehman.

Page1 / 152

LinuxFileSystem - Chapter 12 The Virtual Filesystem One of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online