Expand description
§Generic B-tree search: walking any internal btrfs tree via BTRFS_IOC_TREE_SEARCH
The kernel’s tree search ioctl lets userspace read any internal btrfs tree
(chunk, root, quota, …) by specifying a key range. Items are returned in
batches; tree_search advances the cursor automatically and calls a
closure once per item until the range is exhausted.
§Byte order
SearchHeader fields (objectid, offset, type) are in host byte order:
the kernel fills them in through the ioctl layer. The data slice passed
to the callback contains the raw on-disk item payload, which is
little-endian; callers must use u64::from_le_bytes and friends when
interpreting it.
§Ioctl version
This module uses BTRFS_IOC_TREE_SEARCH (v1) with its fixed 3992-byte
result buffer. This is sufficient for all item types used by this crate;
the v2 variant with a configurable buffer size is not needed.
Structs§
- Search
Header - Metadata returned for each item found by
tree_search. - Search
Key - Parameters specifying which items to return from a tree search.
Functions§
- tree_
search - Walk every item in the tree that falls within
key, callingfonce for each one.