diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-12 00:29:13 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-12 00:29:13 -0600 |
commit | 48a0289cd33314a3fa652f5eb1c8695e9f25fd6a (patch) | |
tree | 8508296ecbd0de2e2c3b484669b14bb6b3040609 /cmd/btrfs-dump-tree | |
parent | 515dfcbef2002aacf49b92aa16843eb8d7232db3 (diff) |
Have WalkTree include path information
Diffstat (limited to 'cmd/btrfs-dump-tree')
-rw-r--r-- | cmd/btrfs-dump-tree/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/btrfs-dump-tree/main.go b/cmd/btrfs-dump-tree/main.go index ad3f126..e32d677 100644 --- a/cmd/btrfs-dump-tree/main.go +++ b/cmd/btrfs-dump-tree/main.go @@ -75,8 +75,8 @@ func Main(imgfilename string) (err error) { } } if err := fs.WalkTree(superblock.Data.RootTree, btrfs.WalkTreeHandler{ - Item: func(key btrfs.Key, body btrfsitem.Item) error { - if key.ItemType != btrfsitem.ROOT_ITEM_KEY { + Item: func(_ btrfs.WalkTreePath, item btrfs.Item) error { + if item.Head.Key.ItemType != btrfsitem.ROOT_ITEM_KEY { return nil } treeName, ok := map[btrfs.ObjID]string{ @@ -98,12 +98,12 @@ func Main(imgfilename string) (err error) { btrfs.FREE_SPACE_TREE_OBJECTID: "free space", btrfs.MULTIPLE_OBJECTIDS: "multiple", btrfs.BLOCK_GROUP_TREE_OBJECTID: "block group", - }[key.ObjectID] + }[item.Head.Key.ObjectID] if !ok { treeName = "file" } - fmt.Printf("%v tree %v \n", treeName, btrfsmisc.FmtKey(key)) - return btrfsmisc.PrintTree(fs, body.(btrfsitem.Root).ByteNr) + fmt.Printf("%v tree %v \n", treeName, btrfsmisc.FmtKey(item.Head.Key)) + return btrfsmisc.PrintTree(fs, item.Body.(btrfsitem.Root).ByteNr) }, }); err != nil { return err |