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-ls-trees/main.go | |
parent | 7e09476e6cf9922baa3c3a49b559b5b9af970561 (diff) |
get initial expected levels from the superblock
Diffstat (limited to 'cmd/btrfs-ls-trees/main.go')
-rw-r--r-- | cmd/btrfs-ls-trees/main.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/btrfs-ls-trees/main.go b/cmd/btrfs-ls-trees/main.go index a444e34..534b095 100644 --- a/cmd/btrfs-ls-trees/main.go +++ b/cmd/btrfs-ls-trees/main.go @@ -8,7 +8,6 @@ import ( "lukeshu.com/btrfs-tools/pkg/btrfs" "lukeshu.com/btrfs-tools/pkg/btrfs/btrfsitem" - "lukeshu.com/btrfs-tools/pkg/btrfs/btrfsvol" "lukeshu.com/btrfs-tools/pkg/btrfsmisc" "lukeshu.com/btrfs-tools/pkg/util" ) @@ -37,11 +36,11 @@ func Main(imgfilenames ...string) (err error) { var treeErrCnt int var treeItemCnt map[btrfsitem.Type]int - btrfsmisc.WalkFS(fs, btrfsmisc.WalkFSHandler{ - PreTree: func(name string, _ btrfs.ObjID, laddr btrfsvol.LogicalAddr) { + btrfsmisc.WalkAllTrees(fs, btrfsmisc.WalkAllTreesHandler{ + PreTree: func(name string, treeID btrfs.ObjID) { treeErrCnt = 0 treeItemCnt = make(map[btrfsitem.Type]int) - fmt.Printf("tree laddr=%v name=%q\n", laddr, name) + fmt.Printf("tree id=%v name=%q\n", treeID, name) }, Err: func(_ error) { treeErrCnt++ @@ -53,7 +52,7 @@ func Main(imgfilenames ...string) (err error) { return nil }, }, - PostTree: func(name string, _ btrfs.ObjID, laddr btrfsvol.LogicalAddr) { + PostTree: func(_ string, _ btrfs.ObjID) { totalItems := 0 for _, cnt := range treeItemCnt { totalItems += cnt |