1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! # Userspace transaction infrastructure for btrfs
//!
//! This crate provides the write-path infrastructure needed to modify btrfs
//! filesystems from userspace. It builds on `btrfs-disk` (which provides the
//! read path) and adds mutable tree blocks, B-tree search, copy-on-write,
//! item insertion/deletion, node splitting, transaction commit, and extent
//! allocation.
//!
//! The primary entry point is [`Filesystem::open`], which opens a device or
//! image file for modification. From there, start a transaction with
//! [`Transaction::start`], modify trees through [`search::search_slot`] and
//! the item operation functions, and commit with [`Transaction::commit`].
//!
//! This is a clean-room implementation based on the on-disk format
//! specification and UAPI headers. It is licensed MIT/Apache-2.0.
//!
//! # Stability
//!
//! This is a pre-1.0, experimental crate. It is a clean-room
//! reimplementation of btrfs's read-write tree machinery and may
//! have edge cases that testing doesn't cover. Do not use it on
//! filesystems you care about without taking a backup first.
// nodesize ≤ 64K, offsets always fit u32
// bytes_used u64↔i64 conversions are intentional
// bytes_used i64↔u64 conversions are intentional
// error conditions obvious from Result<T>
// path.nodes[].unwrap() always valid in context
pub use crate::;