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.

15 of 258 comments (clear)

  1. Silly submitter... by grub · · Score: 5, Funny


    the BeOS rising to join the ranks of OSs that won't die

    An OS isn't dead or dying until Netcraft confirms it.

    --
    Trolling is a art,
  2. Just what I always wanted by Anonymous Coward · · Score: 5, Funny

    A practical file system with an impractical OS!

  3. Re:Future is relational databases by Anonymous Coward · · Score: 1, Funny

    t next to your flight simulator, and supercolliding monkey accelerator?

    No, it's next to the frog-exaggerator.

  4. Holy Crap. I'm a Be-diot. by torpor · · Score: 4, Funny

    All those years I've slagged off Amiga blow^H^H^H^Hdie-hards, and here am I with a rev-a. BeBox I refuse to part with. I love the damn thing. I never noticed it, but I've got Amigazoids' Disease.

    Why, oh why can't someone invent a "Parallel Universe Chunnel" so I can get myself a laptop BeBox. tiBooks come close, but Apple crack is still crack!

    Ah well. At least I have something else (the .PDF) to put on my Amig^H^H^H^HBeBox, beautiful and blue though it sits in the corner, gathering dust, as if there's nothing else to do with it ... ;)

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  5. Re:Ill shout Troll... by nazsco · · Score: 1, Funny
    Ill shout Troll..
    ...to anyone proclaiming this to be old news!
    No, you will not, sice you already posted in this thread.
  6. Re:Crud more file Systems? by FictionPimp · · Score: 5, Funny

    isn't love a journaling filesystem? My girlfriend can remember every little issue I would like to delete.

  7. Thanks For The Reminder by jacoby · · Score: 2, Funny

    I lent a copy to a friend a while ago. I just asked for it back.

    When's the last time you had a PDF book as bathroom reading?

  8. Re:Future is relational databases by rapett0 · · Score: 2, Funny

    Of course, you know the quote that old lady gave to I believe Carl Sagan, "its relational databases all the way down"

  9. Re:Crud more file Systems? by .com+b4+.storm · · Score: 3, Funny

    isn't love a journaling filesystem? My girlfriend can remember every little issue I would like to delete.

    You think that's bad? Wait until you upgrade to the wife filesystem. It won't even let you delete entries for mowing the lawn, etc. from your crontab! Talk about rights management...

    --
    "Wow, you're like some kind of superhero able to ward off happiness and success at every turn."
    -- Ryan Stiles
  10. Re:Future is relational databases by dasmegabyte · · Score: 2, Funny

    Because that's what Microsoft is doing. So it must be wrong (up until Longhorn sells its first 10 million copies, then we'll scramble to implement it).

    --
    Hey freaks: now you're ju
  11. Re:Straight up: your sig is gay beyond belief by jred · · Score: 1, Funny

    Fo' shizzle...

    --

    jred
    I'm not a mechanic but I play one in my garage...
  12. Re:Can you actually read this? by Anonymous Coward · · Score: 1, Funny

    Yeah, actually. Some people find this stuff interesting.

    Clearly you don't. Oh, look - "Who Wants to be a Millionaire" is on! Why don't you run along and pretend to be smart, okay?

  13. Re:Crud more file Systems? by BiggerIsBetter · · Score: 4, Funny

    You think love is bad? Wait till you see the vengence in action. Sure it remembers everything little issue, but using an advanced AI system it creates arbitrary yet realistic scenarios in a multi-threading manner. These can be variously intepreted based on context by others systems reading the disk, which may result in locks and race conditions or possibly even data loss. Love is nice, but wouldn't recommend the post-love vengence patch - best bet is to keep plugging away with what you've got. Don't forget to keep up with maintenance and the system's support needs.

    --
    Forget thrust, drag, lift and weight. Airplanes fly because of money.
  14. Explicate? by FireBreathingDog · · Score: 3, Funny
    His style is very straightforward - introduce idea, explicate idea, summarize idea.

    Isn't it ironic (dontcha think?) that 'explicate' appears in a sentence about straightforward writing? How about explain???

  15. Funny Be IRC quotes by Gunfighter · · Score: 2, Funny

    A few years back, one of the members of my Quake clan was a programmer who preferred BeOS as his platform of choice for development and other everyday tasks. He eventually went to work for Be and we didn't hear from him much after that. Nevertheless, we always gave him hell about his BeOS preference. Here are a few choice quotes from our IRC logs:

    This first one is particularly applicable as it pertains to the "uncorruptable" BeOS filesystem.

    <dEad{Ni}> but you have more problems with win95 than i have ever imagined anyone having
    <Tolen{Ni}> nah...you should see some of the people on my dorm floor...
    <Tolen{Ni}> one guy had to fdisk like 5 times last semester
    <Magaera{Ni}> hehe
    <Magaera{Ni}> You CAN'T corrupt the BeOS file system
    <Magaera{Ni}> Even by kicking out the power cord
    <Gunfighter{Ni}> you can't play Q2 on it either :P

    <Magaera{Ni}> potty stop - brb
    <Gunfighter{Ni}> overkill.. yellow card
    <Magaera{Ni}> what, you'd rather say i was going to "the little programmer's room" or something??
    <Deathwish{Ni}> I got take a BeOS

    <Magaera{Ni}> "BeOS combines the best features of all the major operating systems: the ease-of-use of the Macintosh, the power and flexibility of Linux, and Minesweeper from Windows."

    --
    -- Stu

    /. ID under 2,000. I feel old now.