Expand description
§Logical-to-physical address mapping for btrfs filesystems
Btrfs maps logical addresses to physical device offsets through chunk items stored in the chunk tree. The superblock embeds a small subset of the chunk tree (the system chunk array) to bootstrap access to the full chunk tree.
This module provides a ChunkTreeCache that resolves logical addresses to
physical offsets, seeded from the sys_chunk_array and then populated from
the full chunk tree.
Structs§
- Caller
Overlay - A range of caller bytes that overlays a data column slot.
- Chunk
Mapping - A chunk mapping: maps a range of logical addresses to physical device locations.
- Chunk
Tree Cache - Cache of chunk tree mappings for resolving logical to physical addresses.
- Parity
Data Column - One data column slot in a
ParityRow. - Parity
Plan - Per-row write plan for RAID5/RAID6 chunks.
- Parity
Row - One physical row of a RAID5/RAID6 chunk that the write touches.
- Parity
Target - One parity column slot to write.
- Stripe
- A single stripe in a chunk mapping, identifying a physical location on a device.
- Stripe
Placement - One per-device write or read produced by
ChunkTreeCache::plan_writeorChunkTreeCache::plan_read.
Enums§
- Chunk
Profile - RAID profile derived from a chunk’s
chunk_typeflags. - Parity
Kind - Which parity polynomial a
ParityTargetholds. - Write
Plan - Result of
ChunkTreeCache::plan_write.
Functions§
- chunk_
item_ bytes - Serialize a
ChunkMappinginto the on-diskbtrfs_chunkbyte layout (48-byte fixed header +num_stripes * 32-byte stripes). - parse_
chunk_ item - Parse a chunk item (
btrfs_chunk+ stripes) from a raw byte buffer. - seed_
from_ sys_ chunk_ array - Seed a
ChunkTreeCachefrom the superblock’ssys_chunk_array. - sys_
chunk_ array_ append - Append a single
(disk_key, btrfs_chunk)record to the superblock’ssys_chunk_arraybyte buffer. - sys_
chunk_ array_ contains - Walk the superblock’s
sys_chunk_arrayand returntrueif it already contains a record whosedisk_key.offsetmatchesbg_start(i.e. the system chunk starting at that logical address is already part of the bootstrap snippet).