Академический Документы
Профессиональный Документы
Культура Документы
$
File-System Structure
Allocation Methods
Free-Space Management
Directory Implementation
Efficiency and Performance
Recovery
& %
' $
Operating System Concepts 11.1 Silberschatz and Galvin
1998
c
File-System Structure
File structure
Logical storage unit
Collection of related information
File system resides on secondary storage (disks).
File system organized into layers.
File control block storage structure consisting of information
about a file.
&
Operating System Concepts 11.2 Silberschatz and Galvin
1998
c
%
' Contiguous Allocation
$
Each file occupies a set of contiguous blocks on the disk.
Simple only starting location (block #) and length (number of
blocks) are required.
Random access.
Wasteful of space (dynamic storage-allocation problem).
Files cannot grow.
Mapping from logical to physical.
Q
LA/512
& %
R
' $
Operating System Concepts 11.3 Silberschatz and Galvin
1998
c
Linked Allocation
block = pointer
&
Operating System Concepts 11.4 Silberschatz and Galvin
1998
c
%
' Allocate as needed, link together; e.g., file starts at block 9
directory
$
file start end
0 1 10 2 3 jeep 9 25
4 5 6 7
8 9 16 10 25 11
12 13 14 15
16 1 17 18 19
20 21 22 23
& %
24 25 1 26 27
28 29 30 31
' $
Operating System Concepts 11.5 Silberschatz and Galvin
1998
c
& %
Displacement into block = R + 1
File-allocation table (FAT) disk-space allocation used by
MS-DOS and OS/2.
index table
& %
' $
Operating System Concepts 11.7 Silberschatz and Galvin
1998
c
directory
file index block
0 1 2 3 jeep 19
4 5 6 7
8 9 10 11
9
12 13 14 15 16
1
10
16 17 18 19 19
25
1
20 21 22 23 1
1
24 25 26 27
& %
28 29 30 31
& %
Q = displacement into index table
R = displacement into block
' $
Operating System Concepts 11.9 Silberschatz and Galvin
1998
c
& %
Q2 = displacement into block of index table
R2 = displacement into block of file
& %
R2 = displacement into block of file
' $
Operating System Concepts 11.11 Silberschatz and Galvin
1998
c
..
.
outer-index
&
Operating System Concepts 11.12
index table file
owners (2)
timestamps (3)
data
size block
data
count
data
..
direct blocks .
..
. data
.. data
& %
single indirect .. data
. .
data data
double indirect ..
.
triple indirect .. data
.
data
' $
Operating System Concepts 11.13 Silberschatz and Galvin
1998
c
Free-Space Management
& %
(number of 0-value words) +
offset of first 1 bit
& %
Grouping
Counting
' $
Operating System Concepts 11.15 Silberschatz and Galvin
1998
c
Need to protect:
Pointer to free list
Bit map
Must be kept on disk.
Copy in memory and disk may differ.
Cannot allow for block[i ] to have a situation where bit[i ] =
1 in memory and bit[i ] = 0 on disk.
Solution:
Set bit[i ] = 1 in disk.
& %
Allocate block[i ].
Set bit[i ] = 1 in memory.
& %
fixed size
' $
Operating System Concepts 11.17 Silberschatz and Galvin
1998
c
& %
improve PC performance by dedicating section of memory
as virtual disk, or RAM disk
track
buffer
main memory
& %
' $
Operating System Concepts 11.19 Silberschatz and Galvin
1998
c
Recovery
&
Operating System Concepts 11.20 Silberschatz and Galvin
1998
c
%