File Systems
A file system is the layer of abstraction that stands between “data that has to survive” and “the blocks on a disk”. This chapter works through that abstraction from the outside in.
First, fix the objects themselves: what a file is, which functions a file system has to provide, how its layers are divided, and how the design trades ease of use against performance, reliability, security, and scalability.
Next come naming and lookup. File attributes record metadata such as type, timestamps, and permissions; the directory structure decides how the namespace is organized — from single-level and two-level layouts through trees to acyclic graphs, each one choosing between the risk of name collisions and the convenience of sharing. The structure of directory entries, together with hash-table and B-tree optimizations, is how lookup efficiency is actually achieved in practice.
Then comes space management. Contiguous allocation is intuitive but fragments; linked allocation is flexible but slows down sequential access; indexed allocation balances the two; and hybrid schemes, such as the inode structure of Unix, are the engineering compromise between them.
Finally, protection and concrete implementations. Access control runs from DAC through MAC to RBAC, and combines with ACLs, file encryption, digital signatures, and audit logs to form a complete security system; the structures and characteristics of real systems such as FAT, NTFS, and ext4 then ground each of the abstractions above in actual code and on-disk layout.
By the end of this chapter, you should be able to explain the path a single file read or write takes through the system, compare the trade-offs among different directory structures and allocation methods, and choose a suitable access control model for a concrete scenario.
