File System Implementation
File System Implementation
• File-System Structure
• File-System Implementation
• Directory Implementation
• Allocation Methods
• Free-Space Management
• Recovery
In-Memory File System Structures
In-Memory File System Structures
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
• Garbage collection
• Types of access
– Read
– Write
– Execute
– Append
– Delete
– List
Access Lists and Groups
• Mode of access: read, write, execute
• Three classes of users
RWX
a) owner access 7 111
RWX
b) group access 6 110
RWX
c) public access 1 001
• Ask manager to create a group (unique name), say G, and add some users to the
group.
• For a particular file (say game) or subdirectory, define an appropriate access.
• Sequential Access
• read next
• write next
• reset
• no read after last write
• (rewrite)
• Direct Access
• read n
• write n
• position to n
• read next
• write next
• rewrite n
• n = relative block number
Sequential-access File
Simulation of Sequential Access
on a Direct-access File
Example of Index and Relative
Files
A Typical File-system
Organization