diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 10:04:09 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 10:04:09 -0600 |
commit | cdc2df19c59965149e11c3a5710458c626ea0668 (patch) | |
tree | 2e0bafd99a433d7271bf42e68ab1b5c1eba99e2b /lib/btrfsutil/graph.go | |
parent | 0b092a27122fcf19479d6cdeae5f7c9493d9741a (diff) | |
parent | 94aa0ec3e9f7145cdf177ad6f6d3d8b7d5bdbef7 (diff) |
Merge branch 'lukeshu/node-cache'
Diffstat (limited to 'lib/btrfsutil/graph.go')
-rw-r--r-- | lib/btrfsutil/graph.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfsutil/graph.go b/lib/btrfsutil/graph.go index 39e1cf2..ea33be7 100644 --- a/lib/btrfsutil/graph.go +++ b/lib/btrfsutil/graph.go @@ -17,7 +17,6 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfstree" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" "git.lukeshu.com/btrfs-progs-ng/lib/containers" - "git.lukeshu.com/btrfs-progs-ng/lib/diskio" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/slices" "git.lukeshu.com/btrfs-progs-ng/lib/textui" @@ -199,7 +198,7 @@ func (g Graph) InsertNode(node *btrfstree.Node) { } } -func (g Graph) FinalCheck(ctx context.Context, fs diskio.File[btrfsvol.LogicalAddr], sb btrfstree.Superblock) error { +func (g Graph) FinalCheck(ctx context.Context, fs btrfstree.NodeSource) error { var stats textui.Portion[int] dlog.Info(ctx, "Checking keypointers for dead-ends...") @@ -208,9 +207,10 @@ func (g Graph) FinalCheck(ctx context.Context, fs diskio.File[btrfsvol.LogicalAd progressWriter.Set(stats) for laddr := range g.EdgesTo { if _, ok := g.Nodes[laddr]; !ok { - _, err := btrfstree.ReadNode[btrfsvol.LogicalAddr](fs, sb, laddr, btrfstree.NodeExpectations{ + node, err := fs.AcquireNode(ctx, laddr, btrfstree.NodeExpectations{ LAddr: containers.OptionalValue(laddr), }) + fs.ReleaseNode(node) if err == nil { progressWriter.Done() return fmt.Errorf("node@%v exists but was not in node scan results", laddr) |