diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-29 17:11:27 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 00:11:57 -0600 |
commit | 7f1391d48d63a5f8780dddc41817eaa9df3ce880 (patch) | |
tree | 976590735a86c09059e3eb22cf65e0d851d4ce08 /cmd/btrfs-rec | |
parent | 755ac780df4f653879cb376d27cad7ff8e8d7b0f (diff) |
tree-wide: Funnel all btrfstree.ReadNode[btrfsvol.LogicalAddr]() calls through btrfstree.NodeSource.ReadNode()
Diffstat (limited to 'cmd/btrfs-rec')
-rw-r--r-- | cmd/btrfs-rec/inspect/rebuildtrees/scan.go | 4 | ||||
-rw-r--r-- | cmd/btrfs-rec/inspect_lstrees.go | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/scan.go b/cmd/btrfs-rec/inspect/rebuildtrees/scan.go index 3339270..86d3741 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/scan.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/scan.go @@ -71,7 +71,7 @@ func ScanDevices(ctx context.Context, fs *btrfs.FS, nodeList []btrfsvol.LogicalA if err := ctx.Err(); err != nil { return ScanDevicesResult{}, err } - node, err := btrfstree.ReadNode[btrfsvol.LogicalAddr](fs, *sb, laddr, btrfstree.NodeExpectations{ + node, err := fs.ReadNode(ctx, laddr, btrfstree.NodeExpectations{ LAddr: containers.OptionalValue(laddr), }) if err != nil { @@ -93,7 +93,7 @@ func ScanDevices(ctx context.Context, fs *btrfs.FS, nodeList []btrfsvol.LogicalA dlog.Info(ctx, "... done reading node data") ctx = dlog.WithField(ctx, "btrfs.inspect.rebuild-trees.read.substep", "check") - if err := ret.Graph.FinalCheck(ctx, fs, *sb); err != nil { + if err := ret.Graph.FinalCheck(ctx, fs); err != nil { return ScanDevicesResult{}, err } diff --git a/cmd/btrfs-rec/inspect_lstrees.go b/cmd/btrfs-rec/inspect_lstrees.go index 1449a21..9639a2e 100644 --- a/cmd/btrfs-rec/inspect_lstrees.go +++ b/cmd/btrfs-rec/inspect_lstrees.go @@ -101,13 +101,12 @@ func init() { treeErrCnt = 0 treeItemCnt = make(map[btrfsitem.Type]int) textui.Fprintf(os.Stdout, "lost+found\n") - sb, _ := fs.Superblock() for _, laddr := range nodeList { if visitedNodes.Has(laddr) { continue } visitedNodes.Insert(laddr) - node, err := btrfstree.ReadNode[btrfsvol.LogicalAddr](fs, *sb, laddr, btrfstree.NodeExpectations{ + node, err := fs.ReadNode(ctx, laddr, btrfstree.NodeExpectations{ LAddr: containers.OptionalValue(laddr), }) if err != nil { |