File System Impelementation
File System Impelementation
Allocation Methods
Index table
Indexed Allocation…
lin
k
lin
k
Indexed Allocation…
• Multilevel index
outer-
index
index
table file
• Combined Scheme
Free Space Management
• Need to reuse the space from deleted files for new files
• To keep track of free disk space, the system maintains a
free-space list
– Stores all free blocks – those not allocated to a file or
directory
• To create a file the free-space list is searched and that
space is allocated to the new file, this space is then
removed form the list
• When a file is deleted its disk space is added to the free
space list
Bit Vector
• Frequently, the free-space list is implemented as a
bit-map or bit vector
– Each block is represented by 1 bit
– If the block is free; the bit is 1; if the block is allocated the
bit is 0
0 1 2 n-1
bit[i] =
{ 1 implies block[i] free
Counting
Linked list of contiguous blocks that are free
Free list node contains pointer and number of free
blocks starting from that address.
The Overall list will be shorter.