• Learning Outcomes
• Identify the different things that a file system has to do to bridge between
programmatic file system APIs and a storage device.
• Define (in the context of file systems): • Metadata
Copyright By PowCoder代写 加微信 powcoder
• File Descriptor Table • Vnode
• How we’ll get there:
• Given the file system system call API and how we have to talk to storage
devices, we’ll derive the kinds of functionality that need to fill that gap. • Reading:
• Not covered in the book.
CPSC 313 1
Posix API: hierarchical name space, byte-streams, open, close, read, write
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 2
Posix API: hierarchical name space, byte-streams, open, close, read, write open close read write
Map: Name to file metadata
Find location of file metadata
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 3
Posix API: hierarchical name space, byte-streams, open, close, read, write open close read write
Map: Name to file metadata
File Descriptor Table
Allocate and manage file descriptors
Find location of file metadata
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 4
Posix API: hierarchical name space, byte-streams, open, close, read, write open close read write
Map: Name to file metadata
in-memory file object: VNODE
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 5
Allocate and manage file descriptors
Find location of file metadata
Posix API: hierarchical name space, byte-streams, open, close, read, write
open close
read write
Map: Name to file metadata
Allocate and manage file descriptors
Find location of file metadata
in-memory file object: VNODE
Map: file offsets to disk blocks
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 6
Posix API: hierarchical name space, byte-streams, open, close, read, write
read write
Map: Name to file metadata
Allocate and manage file descriptors
Find location of file metadata
in-memory file object: VNODE
Map: file offsets to disk blocks
Persistent storage: Numbered disk blocks, checksums and ECC, bad block handling
CPSC 313 7
The Parts of a File System
• Metadata:
• We have information about the entire file system. • We have information about each file (inode).
• Managing file descriptors:
• Allocating/freeing file descriptors
• Mapping file descriptors to in-memory objects representing files or directories (folders)
• Naming: Mapping a symbolic name to a particular file or directory (folder): • In-memory representation of the file (or directory/folder) that name represents.
• Persistent structures that associate files with directories (folders)
• Storing files on disk: Mapping a file to its collection of blocks • Maintaining metadata for each file (or directory)
• Deciding where to place files on disk
CPSC 313 8
The Rest of this Unit
• File descriptor management and file sharing • Representing files
• Implementing naming
• Putting it all together (case studies)
CPSC 313 9
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com