summaryrefslogtreecommitdiff
path: root/cmd/btrfs-rec/inspect_rebuildtrees.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-28 20:33:28 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 21:31:45 -0600
commit5f45fa7d378edae2fac73517384749fc73d24e89 (patch)
tree3d38d72068a131e689ab5a8441ae4a6b1308b9f0 /cmd/btrfs-rec/inspect_rebuildtrees.go
parent2e1946a200bf2d6374ecc097916d664f49fd8417 (diff)
tree-wide: Don't pass around a full rebuildmappings.ScanDevicesResult when a simple list of nodes will do
Diffstat (limited to 'cmd/btrfs-rec/inspect_rebuildtrees.go')
-rw-r--r--cmd/btrfs-rec/inspect_rebuildtrees.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/cmd/btrfs-rec/inspect_rebuildtrees.go b/cmd/btrfs-rec/inspect_rebuildtrees.go
index 0b41dd9..5d782cf 100644
--- a/cmd/btrfs-rec/inspect_rebuildtrees.go
+++ b/cmd/btrfs-rec/inspect_rebuildtrees.go
@@ -15,7 +15,6 @@ import (
"github.com/datawire/ocibuild/pkg/cliutil"
"github.com/spf13/cobra"
- "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings"
"git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildtrees"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs"
"git.lukeshu.com/btrfs-progs-ng/lib/textui"
@@ -30,17 +29,14 @@ func init() {
RunE: func(fs *btrfs.FS, cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
- // This is wrapped in a func in order to *ensure* that `nodeScanResults` goes out of scope once
+ // This is wrapped in a func in order to *ensure* that `nodeList` goes out of scope once
// `rebuilder` has been created.
rebuilder, err := func(ctx context.Context) (rebuildtrees.Rebuilder, error) {
- dlog.Infof(ctx, "Reading %q...", args[0])
- nodeScanResults, err := readJSONFile[rebuildmappings.ScanDevicesResult](ctx, args[0])
+ nodeList, err := readNodeList(ctx, args[0])
if err != nil {
return nil, err
}
- dlog.Infof(ctx, "... done reading %q", args[0])
-
- return rebuildtrees.NewRebuilder(ctx, fs, nodeScanResults)
+ return rebuildtrees.NewRebuilder(ctx, fs, nodeList)
}(ctx)
if err != nil {
return err