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.

16 of 258 comments (clear)

  1. Mirror with PDF by BiggestPOS · · Score: 5, Informative

    http://biggestpos.com/pfs/ It took me so long to download the file I thought I'd put it on a faster server for you guys.

    --
    What, me worry?
    1. Re:Mirror with PDF by nacturation · · Score: 4, Informative

      This reminds me of the guy who put up an Adobe Golive PDF book for download. Wired article here. Since nobody reads links, the short story is that it was downloaded 10,000 times in 36 hours and faced a possible $15,000 bandwidth bill (which was later rescinded by Level 3, his hosting company).

      Earthlink wasn't so charitable to a Halo fan who put up a movie previewing Halo and saw it downloaded 100,000 times. Earthlink charged him $30,000 for the 4500 gigabytes downloaded.

      The moral here is that if you're going to put up anything which might be downloaded quite a lot (or if you're expecting a slashdotting), make sure your host doesn't charge through the nose for extra bandwidth. Or, if the file is over 5MB in size (and under 1GB), make a freecache.org link and let others mirror it for you automatically.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    2. Re:Mirror with PDF by kryptkpr · · Score: 4, Informative

      Have you been living under a rock? The solution is BitTorrent!

      --
      DJ kRYPT's Free MP3s!
  2. Need more than one filesystem by Anonymous Coward · · Score: 5, Informative
    All you need is one!

    No. You need four:

    1. Ext2 or Ext3 on primary hard drive
    2. IS09660 on CDs
    3. minix for initrd
    4. FAT for floppies/USB devices
  3. ironic fact by Power+Everywhere · · Score: 5, Informative

    Apple considered buying Be a few years ago for BeOS and opted for NeXT instead. Now, years, later, they have hired several Be engineers to work on the Mac OS X filesystem. It looks like Apple is getting Be without having to buy the whole company. Be fans, look at Tiger as an upgrade for your favorite OS.

  4. Re:Mirrors: by uberdave · · Score: 3, Informative

    Links to the mirrors:

    Link 1

    Link 2

    Link 3

    Really folks, is it so hard to throw a <a></a> tag around a url?

  5. Re:Silly submitter... by nocomment · · Score: 2, Informative

    and since Be lives on, it will probably be awhile before netcraft confirms it. At least Yellowtab, is releasing something whereas amiga hasn't released anything tangible (although they say they have) since os v4.

    --
    /* oops I accidentally made a comment, sorry */
    /* http://allyourbasearebelongto.us */
  6. BitTorrent by gspr · · Score: 4, Informative

    It may be redundant - if it is, just moderate it as such, but here is a Torrent, so that we don't completely destroy the nice BiggestPOS' mirror.
    I'll seed it for an hour or so.

  7. Other possibility by mirko · · Score: 3, Informative

    Another OS which proposed a very ergonomical approach to file system design and implementation was RiscOS.
    Check its Programmer Reference Manuals if you can find these.

    --
    Trolling using another account since 2005.
  8. Re:Future is relational databases by ckaminski · · Score: 2, Informative

    www.objectstore.net

    Amazon.com uses it.

  9. Re:Future is relational databases by no+reason+to+be+here · · Score: 4, Informative

    Actually, Be started with a full database instead of a file-system. They found it to be incredibly slow and crash-prone, and so they developped the marvel that is the Be file system.

  10. Re:Future is relational databases by gwappo · · Score: 4, Informative

    Amusing sarcasm but there's no reason for a database not to write directly to any random access device.

  11. Re:Future is relational databases by Tim+C · · Score: 2, Informative

    I'm no DBA (I'm a programmer), but I *believe* that Oracle can do just that if you configure it to - write directly to a raw disk partition. I can't imagine that it's the only db to do so, either.

  12. Sky Operating System by Anonymous Coward · · Score: 3, Informative

    The BFS lives on in a few other places, most notably in a rebuild by the OpenBeOS team. This file system is also being used by SkyOS for their new file system, SkyFS. They are already making use of the attributes in a number of ways.

  13. Re:Future is relational databases by leandrod · · Score: 2, Informative
    > any relational DB is always fast

    Know you are joking, but for the benefit of others:

    A DB isn't fast, it is just stored at a DBMS. Now a RDBMS can be faster than anything else, because of data independence, that is, the separation of the logical and physical levels of any given database.

    > a POS implimentation

    What does that mean? OneLook gave me so many meanings, I gave up.

    > what would the user experiance on a system built on a database file system be like

    Anything you'd like. Hierarchies can be quite nicely stored in a RDBMS, so one does not need to change much in the user level.

    > would the actual file contents be stored off in another table

    It would be stored in a relation. RDBs don't have tables.

    --
    Leandro Guimarães Faria Corcete DUTRA
    DA, DBA, SysAdmin, Data Modeller
    GNU Project, Debian GNU/Lin
  14. Re:Future is relational databases by VitaminB52 · · Score: 2, Informative

    Yes - Oracle can.
    Oracle also has an iFS, short for Internet File System. It's actually a filesystem inside the Oracle RDBMS, and can be connected to through HTTP, FTP, IMAP4, SMTP, SMB/NTFS, NFS, AFP, etc..
    So Oracle has an relational database that can be used as a file system.