summaryrefslogtreecommitdiff
path: root/pkg/btrfsmisc
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-07-01 23:07:21 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-07-01 23:09:19 -0600
commit2202cfba154b69a947ae45629ef8105de7f63ac4 (patch)
treeaf6fbe8c84b59b709bfbbb82d1c14c35ac0e3748 /pkg/btrfsmisc
parentf1bc48ee12c6873b6b57a2403325765e987ad813 (diff)
Rename TreeWalkPath→TreePath
Diffstat (limited to 'pkg/btrfsmisc')
-rw-r--r--pkg/btrfsmisc/print_tree.go6
-rw-r--r--pkg/btrfsmisc/walk.go8
2 files changed, 7 insertions, 7 deletions
diff --git a/pkg/btrfsmisc/print_tree.go b/pkg/btrfsmisc/print_tree.go
index 3f1dd46..80d279c 100644
--- a/pkg/btrfsmisc/print_tree.go
+++ b/pkg/btrfsmisc/print_tree.go
@@ -15,7 +15,7 @@ import (
// kernel-shared/print-tree.c:btrfs_print_leaf()
func PrintTree(fs *btrfs.FS, root btrfs.LogicalAddr) error {
return fs.TreeWalk(root, btrfs.TreeWalkHandler{
- Node: func(path btrfs.TreeWalkPath, nodeRef *util.Ref[btrfs.LogicalAddr, btrfs.Node], err error) error {
+ Node: func(path btrfs.TreePath, nodeRef *util.Ref[btrfs.LogicalAddr, btrfs.Node], err error) error {
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v: %v\n", path, err)
}
@@ -24,14 +24,14 @@ func PrintTree(fs *btrfs.FS, root btrfs.LogicalAddr) error {
}
return nil
},
- PreKeyPointer: func(_ btrfs.TreeWalkPath, item btrfs.KeyPointer) error {
+ PreKeyPointer: func(_ btrfs.TreePath, item btrfs.KeyPointer) error {
fmt.Printf("\t%v block %v gen %v\n",
FmtKey(item.Key),
item.BlockPtr,
item.Generation)
return nil
},
- Item: func(path btrfs.TreeWalkPath, item btrfs.Item) error {
+ Item: func(path btrfs.TreePath, item btrfs.Item) error {
i := path[len(path)-1].ItemIdx
fmt.Printf("\titem %v %v itemoff %v itemsize %v\n",
i,
diff --git a/pkg/btrfsmisc/walk.go b/pkg/btrfsmisc/walk.go
index 545afb9..8017b69 100644
--- a/pkg/btrfsmisc/walk.go
+++ b/pkg/btrfsmisc/walk.go
@@ -10,7 +10,7 @@ import (
type WalkErr struct {
TreeName string
- Path btrfs.TreeWalkPath
+ Path btrfs.TreePath
Err error
}
@@ -37,7 +37,7 @@ type WalkFSHandler struct {
// will always be of type WalkErr.
func WalkFS(fs *btrfs.FS, cbs WalkFSHandler) {
var treeName string
- handleErr := func(path btrfs.TreeWalkPath, err error) {
+ handleErr := func(path btrfs.TreePath, err error) {
cbs.Err(WalkErr{
TreeName: treeName,
Path: path,
@@ -50,7 +50,7 @@ func WalkFS(fs *btrfs.FS, cbs WalkFSHandler) {
Root btrfs.LogicalAddr
}
origItem := cbs.Item
- cbs.Item = func(path btrfs.TreeWalkPath, item btrfs.Item) error {
+ cbs.Item = func(path btrfs.TreePath, item btrfs.Item) error {
if item.Head.Key.ItemType == btrfsitem.ROOT_ITEM_KEY {
root, ok := item.Body.(btrfsitem.Root)
if !ok {
@@ -73,7 +73,7 @@ func WalkFS(fs *btrfs.FS, cbs WalkFSHandler) {
}
origNode := cbs.Node
- cbs.Node = func(path btrfs.TreeWalkPath, node *util.Ref[btrfs.LogicalAddr, btrfs.Node], err error) error {
+ cbs.Node = func(path btrfs.TreePath, node *util.Ref[btrfs.LogicalAddr, btrfs.Node], err error) error {
if err != nil {
handleErr(path, err)
}