REVIEW o Allocation of Frames o Thrashing o Working-Set Model o Copy-on-Write o Memory-Mapped Files o Other Consideration ·Prepaging ·Page Size
REVIEW Allocation of Frames Thrashing Working-Set Model Copy-on-Write Memory-Mapped Files Other Consideration Prepaging Page Size 1
CHAPTER 11:FILE SYSTEM IMPLEMENTATION
CHAPTER 11: FILE SYSTEM IMPLEMENTATION
Symbolic Open Levels of file name file ID abstraction USER File system interface Files/ directories Directory High-level file and FS management directory functions Logical block Basic file IO system Open/close functions Physical device address Device organization Low-level data methods access functions IO system interface Logical block#
3
CHAPTER 11:FILE SYSTEM IMPLEMENTATION o File-System Structure o File-System Implementation o Directory Implementation o Allocation Methods o Free-Space Management 4
CHAPTER 11: FILE SYSTEM IMPLEMENTATION File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management 4
LAYERED FILE SYSTEM application programs logical file system file-organization module ↓ basic file system ↓ I/O control ↓ devices
LAYERED FILE SYSTEM
FILE SYSTEM IMPLEMENTATION 块 组 续组0 校用N1 块组到 引导块 超级块 索引节点表 数据块 i-node 块组0是引导块,块组1往后分别是超级块,索引 节点表,数据块。 节点号2始终固定的指向根目录(). ·引导块一GRUB/LILO(boot control block) •超级块--空闲索引节点,空间数据块表 (volume control block;superblock;master file table) •索引节点表--文件相关信息及文件位置(FCB) •数据块---存储数据 6
FILE SYSTEM IMPLEMENTATION 块组0是引导块,块组1往后分别是超级块,索引 节点表,数据块。 节点号2始终固定的指向根目录(/). •引导块—GRUB/LILO (boot control block) •超级块---空闲索引节点,空间数据块表 (volume control block; superblock; master file table) •索引节点表----文件相关信息及文件位置 (FCB) •数据块----存储数据 6
A TYPICAL FILE CONTROL BLOCK file permissions file dates(create,access,write) file owner,group,ACL file size file data blocks or pointers to file data blocks
A TYPICAL FILE CONTROL BLOCK
I-NODES I-node Attributes Single indirect block Double Addresses of indirect data blocks block Triple indirect block An i-node with three levels of indirect blocks. 8
I-NODES An i-node with three levels of indirect blocks. 8
UNIX Files inode mode Data owner Data Direct block 0 Direct block 1 Data Direct block 11 Index Single indirect Double indirect- Triple indirect Data Index Data Index Index Index Data Index Data Index Index Data Index Data
9 UNIX Files mode Data owner … Direct block 0 Direct block 1 … Direct block 11 Single indirect Double indirect Triple indirect inode Data Data Index Data Data Index Index Index Data Data Index Index Index Index Index Data Data
DIRECTORY o Single level o Two level o Tree structure ·Path name o Concatenated local names with delimiter:(or or \ oAbsolute path name:start with root () o Relative path name:Start with current directory (.) o Notation to move“upward” (..) o Acyclic graph ·Symbolic link ·Hard link
DIRECTORY Single level Two level Tree structure Path name Concatenated local names with delimiter: ( . or / or \ ) Absolute path name: start with root (/) Relative path name: Start with current directory (.) Notation to move “upward” (..) Acyclic graph Symbolic link Hard link