Slashdot Mirror


Practical File System Design with the Be File System

erikharrison writes "Dominic Giampaolo's Practical File System Design with the Be Filesystem has been around since 1999 - not exactly a new book. The book has been out of print for a time now, however, so Dominic made the book available in PDF form on his website. With this public release of the book, and the BeOS rising to join the ranks of OSs that won't die (hi Amiga!) it makes sense to take a look at what the book has to offer us today." Read on for the rest of Harrison's review below to see just what that is -- it covers a surprisingly broad range. Practical File System Design with the Be File System author Dominic Giampaolo pages 227 pp publisher MORGAN KAUFMANN PUBLISHERS, INC. rating 8.5 of 10 reviewer erikharrison ISBN 1558604979 summary Discusses implemeting a file system, using the Be file system as example

Table of Contents

  • Chapter 1 Introduction to the BeOS and BFS
  • Chapter 2 What Is a File System?
  • Chapter 3 Other File Systems
  • Chapter 4 The Data Structures of BFS
  • Chapter 5 Attributes, Indexing, and Queries
  • Chapter 6 Allocation Policies
  • Chapter 7 Journaling
  • Chapter 8 The Disk Block Cache
  • Chapter 9 File System Performance
  • Chapter 10 The Vnode Layer
  • Chapter 11 User-Level API
  • Chapter 12 Testing
  • Appendix A File System Construction Kit

First thing to note is that Giampaolo is not a great writer, nor is he a bad one. He does not have the gift that some tech writers have of making both an interesting technical document and a fun read. His style is very straightforward - introduce idea, explicate idea, summarize idea. On the other hand, he knows his topic inside and out, and has an obvious enthusiasm for the material, and a real talent for saying things simply without dumbing it down, and his occasional dry wit makes the book a surprisingly easy read.

Giampaolo is doing two things - discussing designing filesystems in general and documenting the Be filesystem. He does both well. BeFS has some advanced features - arbitrary metadata, attribute queries, and indexing. The desire to support these features influences the overall design of the system, but Giampaolo shows how changes to that design change implementation details. The result is a good overview of how a file system works, the trade-offs in optimizing for a particular usage pattern, and how to design one yourself.

The book can be roughly divided into three sections: the first is an overview of how filesystems work and some of the concepts that you encounter - extents, inodes, B-trees, superblocks, and the other standard pieces of a filesystem. Included in this early section is a good high-level overview of the design of five other file systems: BSD FFS, Linux's ext2, Macintosh HFS, Irix XFS, and Windows NT's NTFS. The coverage here strikes a proper balance between too much and too little information. Giampaolo prefers to show rather than to tell, and these filesystem overviews make the connection between design, performance, and features perfectly clear, and provide a solid background to talk about a specific implementation in detail - namely BeFS.

The second section is the bulk of the book - how to implement a filesystem from the ground up, leaning heavily on the BeFS implementation for examples. This is the most straightforward part of the book. Giampaolo covers a single issue in design and implementation in a "Here's the problem, here's and overview of possible solutions and their drawbacks, here's how I did it, now lets summarize" manner. Again, Giampaolo's style makes this an easy if somewhat dry read. As a filesystem and kernel ignoramus, I would have appreciated a slightly more detailed coverage of how all of the various data structures get to disk - how are they serialized, whether endianess is an issue, etc. The BeOS was pretty portable, running at one time or another on the AT&T Hobbit processor, PowerPC, and x86 - I would have liked to have seen portability issues discussed, however, BeFS wasn't written until after the move from the Hobbit to PowerPC, and the book was written prior to the move to x86, so the lack of coverage is reasonable.

Even considering the plain Jane style of this middle section, there are a few gems. The coverage of journaling is excellent, and while I've long understood journaling from a 10,000 foot perspective, this really made me understand the underlying concepts, combined with simple code snippets that helped understand implementation. The Allocation Policies chapter showed in clear terms that disk access is a major bottleneck, and filesystems have become very sophisticated in their optimizations.

The third section of the book deals with some of the more indirect concerns in implementing a file system; specifically, interacting with the kernel, designing a user level API and the major role of testing in filesystem development. This is the one place Giampaolo's writing shines. He really is a good teacher, and this section affords him the chance to talk about the broader perspective of OS design, and even recount a few war stories. For example, in terms of parentage, the BeOS has BSD and classic MacOS as its father and mother. In a few places, such as the Storage Kit API covered in chapter 11, this heritage shows some signs of less-than-seamless integration, and this offers Giampalo a chance to wax philosophical on the nature of OS design, company politics, and the pressure of shipping dates.

In short, the book lives up to it's title. The author is a pragmatist, and offers a clear roadmap for those who have a need to work with low level filesystem implementation. His emphasis on testing, careful optimization, and data structure protection not only helps to show the pitfalls of filesystem work, but also offers a Swiss army knife of techniques to dodge them. The book concludes with a short appendix which covers a file system construction kit, allowing a would-be implementor to begin work on his own filesystem safely without worrying about killing his hard disk. All in all, a solid read.

Here's a link to Practical File System Design with the Be File System as a PDF; you can also look for a used copy at Barnes & Noble. Slashdot welcomes readers' book reviews -- to see your own review here, carefully read the book review guidelines, then visit the submission page.

7 of 258 comments (clear)

  1. My theory by etcremote · · Score: -1, Offtopic

    Join the jihad. join anti-slash

  2. Previous Slashdot Fortunes. by Anonymous Coward · · Score: -1, Offtopic
    Why oh why oh why don't they keep a list of old Slashdot 'Fortunes'. I accidentally pressed my browser's 'reload' button before I could finish reading one, got a new 'Fortune' and couldn't get the old one back no matter howmany times I pressed reload. At least, a new story popped up, so I might get the chance to achieve 'first post' and publicise my plight here.

    Let's have a list of previously used 'Fortunes'

    1. Re:Previous Slashdot Fortunes. by Anonymous Coward · · Score: -1, Offtopic

      OMFG LOL STFU!!

      j00 g0t pwn3d by t3h r3fr3sh butt0n!

      OMFG LOL STFU!!

  3. Re:Tell me honestly by azav · · Score: 0, Offtopic

    Oh, yes, sorry. I did want to say something.

    You are correct. Your post does make you look fat.

    --
    - Zav - Imagine a Beowulf cluster of insensitive clods...
  4. Missed two, mr troll by Anonymous Coward · · Score: -1, Offtopic

    As many of us are already aware, BeOS continues to lose market share. Red ink flows like a river of blood. FreeBSD is the most endangered of them all, having lost 93% of its core developers.

    OpenBSD leader Theo states that there are 7000 users of OpenBeOS.

  5. The Holocaust: Let's Hear Both Sides by Anonymous Coward · · Score: -1, Offtopic

    The Holocaust: Let's Hear Both Sides
    by Mark Weber
    Nearly everyone has heard that the Germans killed some six million Jews in Europe during the Second World War. American television, motion pictures, newspapers and magazines hammer away on this theme. In Washington, DC, an enormous official Holocaust Museum has been built.

    Scholars Challenge Holocaust Story
    During the past decade, though, more and more "revisionist" historians, including respected scholars such as Dr. Arthur Butz of Northwestern University, Prof. Robert Faurisson of the University of Lyon in France and best-selling British historian David Irving, have been challenging the widely-accepted extermination story.

    They do not dispute the fact that large numbers of Jews were deported to concentration camps and ghettos, or that many Jews died or were killed during the Second World War. Revisionist scholars have, however, presented considerable evidence to show that there was no German program to exterminate Europe's Jews, that numerous claims of mass killings in "gas chambers" are false, and that the estimate of six million Jewish wartime dead is an irresponsible exaggeration.

    Many Holocaust Claims Abandoned
    Revisionists point out that the Holocaust story has changed quite a lot over the years. Many extermination claims that were once widely accepted have been quietly dropped in recent years.

    At one time it was alleged that the Germans gassed Jews at Dachau, Buchenwald and other concentration camps in Germany proper. That part of the extermination story proved so untenable that it was abandoned more than 20 years ago.

    No serious historian now supports the once supposedly proven story of "extermination camps" in the territory of the old German Reich. Even famed "Nazi hunter" Simon Wiesenthal has acknowledged that "there were no extermination camps on German soil." (note 1)

    Prominent Holocaust historians now claim that masses of Jews were gassed at just six camps in what is now Poland: Auschwitz, Majdanek, Treblinka, Sobibor, Chelmno and Belzec. However, the "evidence" presented for "gassings" at these six camps is not qualitatively different than the "evidence" for alleged "gassings" at the camps in Germany proper.

    At the great Nuremberg trial of 1945-1946 and during the decades following the end of the Second World War, Auschwitz (especially Auschwitz-Birkenau) and Majdanek (Lublin) were generally regarded as the most important "death camps." For example, the Allies alleged at Nuremberg that the Germans killed four million at Auschwitz and another 1.5 million at Majdanek. Today, no reputable historian accepts these fantastic figures.

    In addition, more and more striking evidence has been presented in recent years that simply cannot be reconciled with the allegations of mass exterminations at these camps. For example, detailed aerial reconnaissance photographs taken of Auschwitz-Birkenau on several random days in 1944 (during the height of the alleged extermination period there) were made public by the CIA in 1979. They show no trace of the piles of corpses, smoking chimneys and masses of Jews awaiting death, all of which have been alleged and would have been clearly visible if Auschwitz had indeed been an extermination center.

    We now also know that the postwar "confession" of Auschwitz commandant Rudolf Höss, which is a crucial part of the Holocaust extermination story, is a false statement that was obtained by torture. (note 2)

    Other Absurd Holocaust Claims
    At one time it was also seriously claimed that the Germans exterminated Jews with electricity and steam, and that they manufactured soap from Jewish corpses. For example, at Nuremberg the United States charged that the Germans killed Jews at Treblinka, not in gas chambers, as is now claimed, but by steaming them to death in "steam chambers." (note 3)

    Such bizarre stories have also been quietly abandoned in recent years.

    Disease Claimed Many Inmates
    The Holocaust extermination story is superfi

  6. Re:BeOS is dying by Anonymous Coward · · Score: -1, Offtopic

    SlashCraft now confirms:

    "is dying" posts are dead