CH - 07 - File System Basics and Operations
CH - 07 - File System Basics and Operations
File-System Structure
File-System Implementation
Directory Implementation
Allocation Methods
Free-Space Management
Efficiency and Performance
Recovery
Log-Structured File Systems
NFS
Example: WAFL File System
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
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.
Contiguous allocation
Linked allocation
Indexed allocation
Random access
LA/512
Many newer file systems (I.e. Veritas File System) use a modified
contiguous allocation scheme
block = pointer
Q
LA/511
R
index table
Q
LA/512
R
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
A page cache caches pages rather than disk blocks using virtual
memory techniques
Routine I/O through the file system uses the buffer (disk) cache
A unified buffer cache uses the same page cache to cache both
memory-mapped pages and ordinary file system I/O
If the file system crashes, all remaining transactions in the log must
still be performed
End of Chapter 11