Chapter 10: File System Implementation
Chapter 10: File System Implementation
week10
CHAPTER 10: FILE SYSTEM
IMPLEMENTATION
2 File-System Implementation
3 Directory Implementation
4 Allocation Methods
5 Free-Space Management
7 Recovery
9 NFS
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.
SCHEMATIC VIEW OF VIRTUAL FILE SYSTEM
DIRECTORY IMPLEMENTATION
Linear list of file names with pointer to the data blocks.
simple to program
time-consuming to execute
Contiguous allocation
Linked allocation
Indexed allocation
CONTIGUOUS ALLOCATION
Each file occupies a set of contiguous blocks on the disk
Random access
LA/512
block = pointer
LINKED ALLOCATION (CONT.)
Simple – need only starting address
Free-space management system – no waste of space
No random access
Mapping
Q
LA/511
R
index table
EXAMPLE OF INDEXED ALLOCATION
INDEXED ALLOCATION (CONT.)
Need index table
Random access
Dynamic access without external fragmentation, but have
overhead of index block.
Mapping from logical to physical in a file of maximum size of
256K words and block size of 512 words. We need only 1 block
for 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
Grouping
Counting
FREE-SPACE MANAGEMENT (CONT.)
Need to protect:
Pointer to free list
Bit map
Must be kept on disk
Allocate block[i]