File System Implementation Flashcards
How does the OS implement a file system?
Disks provide the bulk of secondary storage.
Data transferred block at a time from disk.
File system imposed on secondary storage for convenience.
What types of File System data structures are there?
On-disk structures
- Arrangement of data on the physical storage device
In-memory structures.
- OS structures held in memory.
List the on-disk structures?
- Boot control block
- File control Block
- Directory
- Volume
What is the Boot control block?
Contains the information needed to boot an OS from a disk
Collection of blocks holding a memory image.
What is a Volume Control Block
Structure describing how storage device is separated
Contains partition size, location of free blocks and FCBs
What does the directory structure do?
Organises files.
What is the FCB?
File control block, describes individual file.
Contains:
Permissions, dates, owner, group, ACL, size and data block numbers.
What are the in-memory structures?
Table listing storage volumes in use, and cache of recently accessed directories.
System-wide open file table and Per-Process file table
Fastest structure
How are files created?
- Allocate new FCB
- Read appropriate directory into memory
- Update with file name and FCB.
- Write directory back to disk.
How are files opened?
- Traverse directory structure to obtain FCB with file name/dir path given.
- Copy FCB from disk into System-wide open file table.
- Add pointer to per-process open file table.
- Return File Descriptor
How are files read?
Transfer data blocks in secondary storage to memory by finding them from the System-wide open-file table.
What does a Virtual File System do?
Allows UNIX/linux to support the use of multiple different file systems.
Require concurrent access to multiple file systems, data can be stored on a number of different devices and can have different implementations
What does the VFS allow for?
The same system call interface can be used for different types of file system.
Defines file system operations and semantics
How does VFS abstract the file system?
Builds a single directory tree composed of multiple file systems.
Distinguishes local files from remote ones, activating local file-system-specific operations on ones it knows.
What are the objects that make up the VFS?
- Inode
- File
- Superblock
- Dentry
What is an Inode
Represents an individual file in a file system
What is a file object (VFS)
Represents an open file
What is a superblock object?
Represents an entire file system
What is a Dentry object?
Represent an individual directory entry.