diff options
Diffstat (limited to 'cmd/btrfs-rec/inspect')
-rw-r--r-- | cmd/btrfs-rec/inspect/dumptrees/print_tree.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cmd/btrfs-rec/inspect/dumptrees/print_tree.go b/cmd/btrfs-rec/inspect/dumptrees/print_tree.go index 7703078..75797a8 100644 --- a/cmd/btrfs-rec/inspect/dumptrees/print_tree.go +++ b/cmd/btrfs-rec/inspect/dumptrees/print_tree.go @@ -102,8 +102,7 @@ func printTree(ctx context.Context, out io.Writer, fs *btrfs.FS, treeID btrfspri printHeaderInfo(out, node) itemOffset = node.Size - uint32(nodeHeaderSize) }, - KeyPointer: func(path btrfstree.Path, item btrfstree.KeyPointer) bool { - treeID := path[0].FromTree + KeyPointer: func(_ btrfstree.Path, item btrfstree.KeyPointer) bool { textui.Fprintf(out, "\tkey %v block %v gen %v\n", item.Key.Format(treeID), item.BlockPtr, @@ -111,13 +110,11 @@ func printTree(ctx context.Context, out io.Writer, fs *btrfs.FS, treeID btrfspri return true }, Item: func(path btrfstree.Path, item btrfstree.Item) { - treeID := path[0].FromTree - i := path.Node(-1).FromItemSlot bs, _ := binstruct.Marshal(item.Body) itemSize := uint32(len(bs)) itemOffset -= itemSize textui.Fprintf(out, "\titem %v key %v itemoff %v itemsize %v\n", - i, + path[len(path)-1].(btrfstree.PathItem).FromSlot, //nolint:forcetypeassert // has to be item.Key.Format(treeID), itemOffset, itemSize) |