9 File Systems
9 File Systems
Introduction
All computer applications need to store and retrieve
information.
A process can store a limited amount of information within its
own address space
Storage capacity is restricted to the size of the virtual
address space
For some applications this size is adequate, but for others,
such as airline reservations, banking, or corporate record
keeping, it is far too small.
Applications require information to outlive the processes
To enable sharing, information must be independent of the
processes
File Systems
Directory
Files
F1 F2 F4
F3
Fn
Create a file
Delete a file
List a directory
Rename a file
Naming problem
Grouping problem
Two-Level Directory
Separate directory for each user
Path name
Can have the same file name for different user
Efficient searching
No grouping capability
Tree-Structured Directories
Tree-Structured Directories (Cont.)
Efficient searching
Grouping Capability
Acyclic-Graph Directories
Acyclic-Graph Directories (Cont.)
Two different names (aliasing)
If dict deletes list dangling pointer
If we delete a file, we have to locate the links and remove them
May be expensive if no list exists
We can leave the links until an attempt is made to use them.
Another approach to deletion is to preserve the file until all references to it
are deleted.
To implement this approach, we must have some mechanism
for determining that the last reference to the file has been deleted.
I-nodes
Another method for keeping track of which blocks belong to which
file is to associate with each file a data structure called an i-node
(index-node), which lists the attributes and disk addresses of the
file's blocks.
The big advantage of this scheme over linked files using an in-
memory table is that the i-node need only be in memory when the
corresponding file is open.
If each i-node occupies n bytes and a maximum of k files may be
open at once, the total memory occupied by the array holding the
i-nodes for the open files is only kn bytes
i-node