Skip to main content

Module chunk

Module chunk 

Source
Expand description

§Chunk: 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§

ChunkMapping
A chunk mapping: maps a range of logical addresses to physical device locations.
ChunkTreeCache
Cache of chunk tree mappings for resolving logical to physical addresses.
Stripe
A single stripe in a chunk mapping.

Functions§

parse_chunk_item
Parse a chunk item (btrfs_chunk + stripes) from a raw byte buffer.
seed_from_sys_chunk_array
Seed a ChunkTreeCache from the superblock’s sys_chunk_array.