程序代写 CPSC 313 1

Today: Why Fixed-Sized Blocks?
• Today’s Learning Outcomes
• Define sparse file
• Identify the design considerations that lead us to focus on file representations using collections of fixed-size blocks

Copyright By PowCoder代写 加微信 powcoder

• Explain how we can decouple allocation units from layout policies
CPSC 313 1

• We pick a block size (some multiple of a sector).
• All files are composed of some number of these fixed-size blocks.
How much metadata does it require? One disk address per block How is internal fragmentation? Depends on how large the block is. Performance? Could be bad if blocks are scattered!
How is external fragmentation? There is none!
Any other problems? If the file were really large, the metadata could get big
CPSC 313 2
File metadata (inode)

Allocating in Individual blocks looks poor
• One disk address per block of metadata
• If the blocks are scattered all over the disk, performance would be
• If the file were large, the metadata become large too.
CPSC 313 3

Things we didn’t consider
• POSIX says that you create files by simply writing bytes to them; files grow dynamically.
• Extent-based allocation is not well-matched to this model. • Some files are sparse
• Files can have holes in them:
• Examples:
• Virtual Machine images (their size reflects the total size of the virtual disk, even if that
disk is empty)
• When programs “drop core” — core files have many unused spaces
• Extent-based files must typically allocate disk space for the entire file
CPSC 313 4

Key Insight
• We can allocate individual blocks, but we can still try to allocate them contiguously or near each other to achieve the performance of extents with the flexibility of fixed-size blocks.
• We can decouple the unit of allocation from where we allocate these units on the disk.
• Key questions:
• How do we structure metadata to represent fixed-block allocation efficiently? •
• How do we manage the disk to facilitate good block layout? •

Key Insight
• We can allocate blocks a block at a time, but we can still try to allocate them contiguously or near each other to achieve the performance of extents with the flexibility of fixed-size blocks.
• We can decouple the unit of allocation from where we allocate these units on the disk.
• Key questions:
• How do we structure metadata to represent fixed-block allocation efficiently? • Next class
• How do we manage the disk to facilitate good block layout? • Next week

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com