diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-29 10:00:18 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 10:03:50 -0600 |
commit | 94aa0ec3e9f7145cdf177ad6f6d3d8b7d5bdbef7 (patch) | |
tree | 2e0bafd99a433d7271bf42e68ab1b5c1eba99e2b /lib/btrfsutil/graph.go | |
parent | 2eb7033431866cb05d235eb10c280a4810bf88a7 (diff) |
btrfstree: Change the NodeSource API so that it can do caching
Diffstat (limited to 'lib/btrfsutil/graph.go')
-rw-r--r-- | lib/btrfsutil/graph.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/btrfsutil/graph.go b/lib/btrfsutil/graph.go index 4148f89..ea33be7 100644 --- a/lib/btrfsutil/graph.go +++ b/lib/btrfsutil/graph.go @@ -207,9 +207,10 @@ func (g Graph) FinalCheck(ctx context.Context, fs btrfstree.NodeSource) error { progressWriter.Set(stats) for laddr := range g.EdgesTo { if _, ok := g.Nodes[laddr]; !ok { - _, err := fs.ReadNode(ctx, 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) |