Skip to main content

read_node

Function read_node 

Source
pub fn read_node(
    image: &[u8],
    sb: &Superblock,
    chunk_map: &ChunkMap,
    logical: u64,
) -> Result<Node, BtrfsError>
Expand description

Read the btrfs node at logical address logical: translate it to a physical offset via chunk_map (falling back to the superblock sys_chunk_array bootstrap for addresses inside the chunk_root’s own range), slice nodesize bytes, and parse the header + items/pointers.

§Errors

  • BtrfsError::Truncated if logical cannot be translated to a physical offset, or the resulting nodesize-byte block lies outside image.