CH 12
CH 12
CH 12
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.
Contiguous allocation
Linked allocation
Indexed allocation
Random access.
block = pointer
index table
Q1
LA / (512 x 511)
R1
Q1 = block of index table
R1 is used as follows: Q2
R1 / 512
R2
Q1
LA / (512 x 512)
R1
outer-index
0 block[i] free
bit[i] =
1 block[i] occupied
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
Performance
disk cache – separate section of main memory for frequently
used blocks
free-behind and read-ahead – techniques to optimize
sequential access
improve PC performance by dedicating section of memory
as virtual disk, or RAM disk.
Routine I/O through the file system uses the buffer (disk)
cache.