diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-08 00:05:52 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-08 01:29:21 -0600 |
commit | 8e27c43c1b882c8f2f759eec556f90229c067cc9 (patch) | |
tree | 7a94a92d19f6639c07263537f49226406dd5b4e5 /cmd/btrfs-dump-tree | |
parent | 7e09476e6cf9922baa3c3a49b559b5b9af970561 (diff) |
get initial expected levels from the superblock
Diffstat (limited to 'cmd/btrfs-dump-tree')
-rw-r--r-- | cmd/btrfs-dump-tree/main.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/btrfs-dump-tree/main.go b/cmd/btrfs-dump-tree/main.go index 7f1aba4..56727d4 100644 --- a/cmd/btrfs-dump-tree/main.go +++ b/cmd/btrfs-dump-tree/main.go @@ -41,29 +41,29 @@ func Main(imgfilename string) (err error) { fmt.Printf("btrfs-progs v%v\n", version) if superblock.Data.RootTree != 0 { fmt.Printf("root tree\n") - if err := btrfsmisc.PrintTree(fs, superblock.Data.RootTree); err != nil { + if err := btrfsmisc.PrintTree(fs, btrfs.ROOT_TREE_OBJECTID); err != nil { return err } } if superblock.Data.ChunkTree != 0 { fmt.Printf("chunk tree\n") - if err := btrfsmisc.PrintTree(fs, superblock.Data.ChunkTree); err != nil { + if err := btrfsmisc.PrintTree(fs, btrfs.CHUNK_TREE_OBJECTID); err != nil { return err } } if superblock.Data.LogTree != 0 { fmt.Printf("log root tree\n") - if err := btrfsmisc.PrintTree(fs, superblock.Data.LogTree); err != nil { + if err := btrfsmisc.PrintTree(fs, btrfs.TREE_LOG_OBJECTID); err != nil { return err } } if superblock.Data.BlockGroupRoot != 0 { fmt.Printf("block group tree\n") - if err := btrfsmisc.PrintTree(fs, superblock.Data.BlockGroupRoot); err != nil { + if err := btrfsmisc.PrintTree(fs, btrfs.BLOCK_GROUP_TREE_OBJECTID); err != nil { return err } } - if err := fs.TreeWalk(superblock.Data.RootTree, btrfs.TreeWalkHandler{ + if err := fs.TreeWalk(btrfs.ROOT_TREE_OBJECTID, btrfs.TreeWalkHandler{ Item: func(_ btrfs.TreePath, item btrfs.Item) error { if item.Head.Key.ItemType != btrfsitem.ROOT_ITEM_KEY { return nil @@ -92,7 +92,7 @@ func Main(imgfilename string) (err error) { treeName = "file" } fmt.Printf("%v tree %v \n", treeName, btrfsmisc.FmtKey(item.Head.Key)) - return btrfsmisc.PrintTree(fs, item.Body.(btrfsitem.Root).ByteNr) + return btrfsmisc.PrintTree(fs, item.Head.Key.ObjectID) }, }); err != nil { return err |