Linux Kernel - Advanced Topics: Filesystems
Duration: 2 days

Back to course list Home
Synopsis Go deeper into the Linux Kernel - by getting to know its Virtual File System layer and its block I/O layer. Discussing how Linux interprets the UNIX file system standard, and implements block devices, buffering, and various other features. Examples from real file systems, like FAT and HFS.
Target Audience Developers with knowledge of the Linux Kernel (as provided by the Linux Kernel Programming course, or equivalent)
Prerequisites
Objectives
  • Describe the architecture of the Linux filesystems stack
  • Know the Linux Virtual Filesystem Switch
  • Walk through a sample filesystem implementation
Exercises This course allocates plenty of time for hands-on practice.
The hands-on exercises include:
  • Creating a simple RAM-based filesystem
  • Creating a fullly functional file system driver
Modules
1. The Linux Device Driver architecture
2 hours
Introduction to the Linux Device Driver architecture. In a brief recap, we discuss the design and implementation of the Linux Kernel and its various subsystems, especially as it pertains to block devices (yet).
  • Linux Kernel features
    • The Linux I/O Schedulers, in depth
      • Elevator/NoOp
        • DeadLine
          • Anticipatory
            • Complete Fair Queueing (CFQ)
              • Creating a custom scheduler
              2. Block Device Drivers
              2 hours
              Linux Block Devices are quite different from their character-based kin. Whereas the latter are simple and straightforward, they require more complicated interaction with the I/O scheduler, and asynchronous operation. This module explains in detail the basics of a block device, including a simple implementation.
              • Block Device basics
                • Architecture
                  • Creating a simple block device
                    3. Filesystem basics, from the VFS persepctive
                    2 hours
                    A discussion of the UNIX VFS, as it is implemented in Linux.
                    • The need for VFS
                      • VFS basic primitives
                        • The iNode
                          • The dEntry
                            • Superblock
                            • VFS as an adapter layer to the underlying filesystem
                              4. The Block I/O Layer (Buffer Cache)
                              4 hours
                              Linux filesystems do not talk directly with block devices. Instead, the buffer cache is the layer with which they interact. We explain this layer in detail.
                              • Why buffer?
                                • The Linux Buffer Cache implementation
                                  • Interfacing with the buffer cache
                                    • Optimizations
                                      Day 2
                                      5. Walking through filesystems
                                      4 hours
                                      Examining and walking through the key file system implementations in Linux. We explain the key filesystem concepts (i.e. the Theory), followed by the actual code of the Linux module implementation.
                                      • FAT - A simply lazy filesystem implementation
                                        • EXTx - The native Linux filesystems
                                          • HFS+ - The Mac Filesystem, with journaling.
                                            6. A Simple RAM filesystem
                                            4 hours
                                            Exercise: Creating a simple RAM filesystem implementation