操作系统第十一章
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
for different types of file systems.
The API is to the VFS interface, rather than any specific type
of file system.
Operating System Concepts – 7th Edition, Jan 1, 2005
Contiguous Allocation of Disk Space
OperatingHale Waihona Puke BaiduSystem Concepts – 7th Edition, Jan 1, 2005
11.15
Silberschatz, Galvin and Gagne ©2005
Extent-Based Systems
information about a file
Operating System Concepts – 7th Edition, Jan 1, 2005
11.4
Silberschatz, Galvin and Gagne ©2005
Layered File System
Operating System Concepts – 7th Edition, Jan 1, 2005
Operating System Concepts – 7th Edition, Jan 1, 2005
11.18
Silberschatz, Galvin and Gagne ©2005
Linked Allocation
Operating System Concepts – 7th Edition, Jan 1, 2005
Collection of related information
File system resides on secondary storage (disks) File system organized into layers File control block – storage structure consisting of
Extents are allocated for file allocation
A file consists of one or more extents.
Operating System Concepts – 7th Edition, Jan 1, 2005
11.16
Silberschatz, Galvin and Gagne ©2005
In-Memory File System Structures
The following figure illustrates the necessary file system
structures provided by the operating systems.
Figure 12-3(a) refers to opening a file. Figure 12-3(b) refers to reading a file.
Directory Implementation
Linear list of file names with pointer to the data blocks.
simple to program
time-consuming to execute
Hash Table – linear list with hash data structure.
No random access
Mapping
Q LA/511 R Block to be accessed is the Qth block in the linked chain of blocks representing the file. Displacement into block = R + 1 File-allocation table (FAT) – disk-space allocation used by MSDOS and OS/2.
11.17
Silberschatz, Galvin and Gagne ©2005
Linked Allocation (Cont.)
Simple – need only starting address Free-space management system – no waste of space
Linked Allocation
Each file is a linked list of disk blocks: blocks may be scattered
anywhere on the disk.
block
=
pointer
Operating System Concepts – 7th Edition, Jan 1, 2005
Many newer file systems (I.e. Veritas File System) use a
modified contiguous allocation scheme
Extent-based file systems allocate disk blocks in extents An extent is a contiguous block of disks
11.19
Silberschatz, Galvin and Gagne ©2005
File-Allocation Table
Operating System Concepts – 7th Edition, Jan 1, 2005
11.20
Silberschatz, Galvin and Gagne ©2005
disk
Simple – only starting location (block #) and length
(number of blocks) are required
Random access Wasteful of space (dynamic storage-allocation
Operating System Concepts – 7th Edition, Jan 1, 2005
11.7
Silberschatz, Galvin and Gagne ©2005
In-Memory File System Structures
Operating System Concepts – 7th Edition, Jan 1, 2005
11.8
Silberschatz, Galvin and Gagne ©2005
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
Operating System Concepts – 7th Edition, Jan 1, 2005
11.12
Silberschatz, Galvin and Gagne ©2005
Contiguous Allocation
Each file occupies a set of contiguous blocks on the
trade-offs
Operating System Concepts – 7th Edition, Jan 1, 2005
11.3
Silberschatz, Galvin and Gagne ©2005
File-System Structure
File structure
Logical storage unit
Q LA/512 R
Block to be accessed = ! + starting address Displacement into block = R
Operating System Concepts – 7th Edition, Jan 1, 2005
11.14
Silberschatz, Galvin and Gagne ©2005
11.9
Silberschatz, Galvin and Gagne ©2005
Schematic View of Virtual File System
Operating System Concepts – 7th Edition, Jan 1, 2005
11.10
Silberschatz, Galvin and Gagne ©2005
Allocation Methods Free-Space Management Efficiency and Performance Recovery Log-Structured File Systems NFS Example: WAFL File System
Operating System Concepts – 7th Edition, Jan 1, 2005
11.11
Silberschatz, Galvin and Gagne ©2005
Allocation Methods
An allocation method refers to how disk blocks are allocated
for files:
Contiguous allocation Linked allocation Indexed allocation
11.5
Silberschatz, Galvin and Gagne ©2005
A Typical File Control Block
Operating System Concepts – 7th Edition, Jan 1, 2005
11.6
Silberschatz, Galvin and Gagne ©2005
11.2
Silberschatz, Galvin and Gagne ©2005
Objectives
To describe the details of implementing local file systems and
directory structures
To describe the implementation of remote file systems To discuss block allocation and free-block algorithms and
decreases directory search time
collisions – situations where two file names hash to the same location
fixed size
Operating System Concepts – 7th Edition, Jan 1, 2005
Indexed Allocation
Brings all pointers together into the index block. Logical view.
index table
Operating System Concepts – 7th Edition, Jan 1, 2005
problem)
Files cannot grow
Operating System Concepts – 7th Edition, Jan 1, 2005
11.13
Silberschatz, Galvin and Gagne ©2005
Contiguous Allocation
Mapping from logical to physical
Chapter 11: File System Implementation
Chapter 11: File System Implementation
File-System Structure File-System Implementation
Directory Implementation