Β§41.7–41.8FFS's Other Innovations, and Summary

Part III OSTEP pp. 520–522 Β· ~5 min read

  • sub-block

Beyond disk-aware layout, FFS added several smaller innovations β€” and, just as importantly, several usability features.

41.7 A Few Other Things About FFS

Sub-blocks for small files. Many files were ~2 KB, but 4 KB blocks are great for transfer and terrible for space: a small file could waste half its block to internal fragmentation. FFS introduced sub-blocks β€” 512-byte fragments it could allocate to a small file so it didn’t burn a whole 4 KB block:

One 4 KB block for a 1 KB file1 KB3 KB wasted (internal fragmentation)Two 512 B sub-blocks for the same file512512no waste β€” coalesced into a 4 KB block as the file grows

As the file grew past 4 KB of sub-blocks, FFS would copy them into a proper 4 KB block and free the sub-blocks. That copying is wasteful, so FFS mostly sidestepped it by having libc buffer writes and issue them in 4 KB chunks β€” avoiding sub-blocks entirely in the common case.

A parameterized, disk-aware layout. On old drives, the CPU had to feed the disk in real time, and a naive consecutive layout lost a full rotation between each block. FFS staggered the layout to match the disk’s timing:

Old disks needed the CPU to keep up. If blocks 0,1,2… sat in consecutive sectors, block 1 rotated past the head before the next read was issued β€” costing a full rotation. FFS staggered the layout so the next block arrives just in time. (Blue = block 0 at the head; green/red = where block 1 sits.)
head01234567891011block 1 just missed β†’ full rotation lost

1Standard (consecutive) layout

Blocks laid out 0, 1, 2, … in adjacent sectors. FFS reads block 0; by the time it issues the read for block 1, block 1 has already spun past the head β€” so it must wait an entire rotation to come back around.

step 1 / 2

This only reached 50% of peak (you circle each track twice), and modern drives made it obsolete: they read a whole track into an internal track buffer , so the file system no longer has to worry about such low-level timing. Good abstractions win.

Usability features. FFS also introduced things that just made the system nicer to use: long file names (instead of fixed 8-character names), symbolic links (aliases that, unlike hard links, can cross file systems and point to directories), and an atomic rename().

Tip: Make The System Usable

FFS’s deepest idea was disk-aware layout β€” but its usability features (long names, symlinks, atomic rename) mattered just as much for adoption. Making a system pleasant to use is often as important as its technical breakthroughs.

41.8 Summary

FFS was a watershed: it showed that file management is one of the most interesting problems in an OS, and taught the enduring lesson β€” treat the disk like a disk, respecting its real positioning costs. Hundreds of file systems followed; Linux ext2 and ext3 are direct intellectual descendants, inheriting FFS’s block groups and locality-aware allocation.

Next, we turn from performance to reliability: what happens to all these carefully-placed structures when the system crashes mid-update?

Check yourself: FFS's other innovations

1.What problem do sub-blocks solve, and how?

2.How did FFS mostly AVOID the overhead of sub-block copying?

3.Why did FFS stagger blocks across the track (a parameterized layout)?

4.What made FFS's parameterized (staggered) layout obsolete?

5.Which usability features did FFS introduce, and why did they matter?

6.What is the enduring one-line lesson of FFS?

6 questions