summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfstree/btree.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 23:54:56 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 23:54:56 -0400
commit0f96c9ce920875babd4cd23819a2fb2960dc0cc6 (patch)
treef50d5a547f354413f45b9a9d497af77a31a7d10b /lib/btrfs/btrfstree/btree.go
parent0f85e72d1331b49b52925d6cc5ad083a0376104c (diff)
parent3fea600da8e033abb7e415694e53aaf0787ed95c (diff)
Merge branch 'lukeshu/api-cleanup'
Diffstat (limited to 'lib/btrfs/btrfstree/btree.go')
-rw-r--r--lib/btrfs/btrfstree/btree.go22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/btrfs/btrfstree/btree.go b/lib/btrfs/btrfstree/btree.go
index 89d4f9d..e91fcc1 100644
--- a/lib/btrfs/btrfstree/btree.go
+++ b/lib/btrfs/btrfstree/btree.go
@@ -11,8 +11,6 @@ import (
"fmt"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsprim"
- "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol"
- "git.lukeshu.com/btrfs-progs-ng/lib/diskio"
)
type TreeSearcher interface {
@@ -71,20 +69,20 @@ type TreeWalkHandler struct {
// node immediately stops getting processed; if PreNode, Node,
// or BadNode return io/fs.SkipDir then key pointers and items
// within the node are not processed.
- PreNode func(TreePath) error
- Node func(TreePath, *diskio.Ref[btrfsvol.LogicalAddr, Node]) error
- BadNode func(TreePath, *diskio.Ref[btrfsvol.LogicalAddr, Node], error) error
- PostNode func(TreePath, *diskio.Ref[btrfsvol.LogicalAddr, Node]) error
+ PreNode func(Path) error
+ Node func(Path, *Node) error
+ BadNode func(Path, *Node, error) error
+ PostNode func(Path, *Node) error
// Callbacks for items on interior nodes
- PreKeyPointer func(TreePath, KeyPointer) error
- PostKeyPointer func(TreePath, KeyPointer) error
+ PreKeyPointer func(Path, KeyPointer) error
+ PostKeyPointer func(Path, KeyPointer) error
// Callbacks for items on leaf nodes
- Item func(TreePath, Item) error
- BadItem func(TreePath, Item) error
+ Item func(Path, Item) error
+ BadItem func(Path, Item) error
}
type TreeError struct {
- Path TreePath
+ Path Path
Err error
}
@@ -96,5 +94,5 @@ func (e *TreeError) Error() string {
type NodeSource interface {
Superblock() (*Superblock, error)
- ReadNode(TreePath) (*diskio.Ref[btrfsvol.LogicalAddr, Node], error)
+ ReadNode(Path) (*Node, error)
}