提纲 File-System Structure FS Implementation Directory Implementation Allocation Methods(分配方法) Free-Space Management Efficiency(空间)and Performance(时间) Recovery Log Structured File Systems 小结 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 提纲 File-System Structure FS Implementation Directory Implementation Allocation Methods (分配方法) Free-Space Management Efficiency (空间) and Performance (时间) Recovery Log Structured File Systems 小结
File-System Structure File structure Logical storage unit Collection of related informationapplication programs ↓ FS resides on secondary storage File name logical file system (disks) ↓ FS organization Logical block address file-organization module How FS should look to the user ↓ Physical block address How to map the logical FS onto basic file system the physical secondary-storage ↓ Issue commands to l/O to retrieve physical block devices l/O control FS organized into layers Hardware-specific instructions devices Figure:Layered File System 口”48+4在4色”主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File-System Structure ▶ File structure ▶ Logical storage unit ▶ Collection of related information ▶ FS resides on secondary storage (disks) ▶ FS organization ▶ How FS should look to the user ▶ How to map the logical FS onto the physical secondary-storage devices ▶ FS organized into layers application programs File name logical file system Logical block address file-organization module Physical block address basic file system Issue commands to I/O to retrieve physical block I/O control Hardware-specific instructions devices Figure: Layered File System
Outline FS Implementation 4口”4614在4生:主QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline FS Implementation
FS Implementation Structures and operations used to implement file system operation,OS-&FS-dependment 1.On-disk structures 2.In-memory structures 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FS Implementation ▶ Structures and operations used to implement file system operation, OS- & FS-dependment 1. On-disk structures 2. In-memory structures
FS Implementation 1.On-disk structures 1.1 Boot control block To boot an OS from the partition(volume) If empty,no OS is contained on the partition 1.2 Volume control block 1.3 Directory structure 1.4 Per-file FCB file permissions file dates(create,access,write) file owner,group,ACL file size file data blocks or pointers to file data blocks Figure:A typical file control block 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FS Implementation 1. On-disk structures 1.1 Boot control block ▶ To boot an OS from the partition (volume) ▶ If empty, no OS is contained on the partition 1.2 Volume control block 1.3 Directory structure 1.4 Per-file FCB file permissions file dates (create, access, write) file owner, group, ACL file size file data blocks or pointers to file data blocks Figure: A typical file control block
FS Implementation 2.In-memory information:For both FS management and performence improvement via caching Data are loaded at mount time and discarded at dismount Structures include: in-memory mount table; in-memory directory-structure cache system-wide open-file table; per-process open-file table 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FS Implementation 2. In-memory information: For both FS management and performence improvement via caching ▶ Data are loaded at mount time and discarded at dismount ▶ Structures include: ▶ in-memory mount table; ▶ in-memory directory-structure cache ▶ system-wide open-file table; ▶ per-process open-file table
FS Implementation 2.In-memory information:For both FS management and performence improvement via caching Data are loaded at mount time and discarded at dismount Structures include: Sppen (file name directory structure directory structure file-control block user space kemnel memory secondary storage (a) index 口口口 read (index 口口口 directory blocks per-process system-wide open file table open file table file-control block user space kernel memory secondary storage (b) 口”48+4在4色主月Q0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FS Implementation 2. In-memory information: For both FS management and performence improvement via caching ▶ Data are loaded at mount time and discarded at dismount ▶ Structures include: ▶ in-memory mount table; ▶ in-memory directory-structure cache ▶ system-wide open-file table; ▶ per-process open-file table user space open (file name) kernel memory directory structure secondary storage file-control block directory structure (a) user space read (index) kernel memory per-process open file table system-wide open file table secondary storage file-control block directory blocks index (b)
Partitions and mounting Partition(分区) Raw(E.g.UNIX swap space some database)VS. cooked Boot information,with its own format Boot image Boot loader unstanding multiple FSes OSes Dual-boot Root partition is mounted at boot time Others can be automatically mounted at boot or manually mounted later 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Partitions and mounting ▶ Partition (分区) ▶ Raw (E.g. UNIX swap space & some database) VS. cooked ▶ Boot information, with its own format ▶ Boot image ▶ Boot loader unstanding multiple FSes & OSes Dual-boot ▶ Root partition is mounted at boot time ▶ Others can be automatically mounted at boot or manually mounted later
Virtual File Systems(虚拟文件系统) Virtual File Systems(VFS,虚拟文件系统)provide an object-oriented way of implementing file systems. VFS allows the same system call interface(the APl)to be used for different types of file systems. The APl is to the VFS interface,rather than any specific type of file system. file-system interface VFS interface local file system local file system remote file system type 1 type 2 type 1 dis network Schematic View of Virtual File System 口”4814在4生,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Virtual File Systems (虚拟文件系统) ▶ Virtual File Systems (VFS, 虚拟文件系统) provide an object-oriented way of implementing file systems. ▶ VFS allows the same system call interface (the API) to be used for different types of file systems. ▶ The API is to the VFS interface, rather than any specific type of file system. local file system type 1 disk local file system type 2 disk remote file system type 1 network VFS interface file-system interface Schematic View of Virtual File System
Outline Directory Implementation 4口”4814在,4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline Directory Implementation