Filesystems Flashcards
Open-File Table
Purpose: avoid multiple searches of file directory structure
Contents: contains directory entries of the opened files
Per-process open-file table
Contains entry per opened file
Every entry has a current-file pointer, as well as a pointer to the system-wide table
System-wide open-file table
contains file info which is identical for all process
3 implementations of Directory Structures
- Linear list
- Binary tree
- hash function
Access Methods
- sequential access: read from first to last
- direct or relative access: give number
Allocation method: Continuous Allocation
Each file has number of consecutive blocks.
+ fast sequential and direct access
- Problem: Dynamically increasing file size
Allocation method: Linked/Chained Allocation
Each file forms a linked list of random blocks
+ fast sequential access
- slow direct access
Disadvantage:
- Possibly slow access
- lose number of bytes per block for pointer
=> resolve by forming clusters
FAT: File Allocation Table
Variant of linked allocation
Fat contains entry per disk block
Indexed Allocation
Each file has number of random blocks + index block
-> very fast direct access
Index is at least 1 block
-> large files = multiple blocks
Free-space Management
- Bit vector: bit per block, 1 = free
=> too long for today’s systems - Linked List => difficult to support continuous allocation
- Index solution: index to free blocks
Journaling?
Quick recover the file system after a crash or power outage by specifying on disk what changes we want to make before we make them.
-> put transaction into log, perform, delete from log. After crash things in log? Perform!