summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-04-08 18:34:00 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-13 13:43:16 -0600
commit2bca1422067e0de0a5ec1b37c37f280e797a8072 (patch)
tree6ba61ddee8f41610254990de1b6cc60148e02c4a
parentc9ca78f970f0b48fbf6965e8ec15f6b8f31ce485 (diff)
btrfsutil: RebuiltForrest: Have the ancestor id-to-ptr map persist
-rw-r--r--lib/btrfsutil/rebuilt_tree.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/btrfsutil/rebuilt_tree.go b/lib/btrfsutil/rebuilt_tree.go
index ca5ccf3..e507851 100644
--- a/lib/btrfsutil/rebuilt_tree.go
+++ b/lib/btrfsutil/rebuilt_tree.go
@@ -81,6 +81,9 @@ type rebuiltPathInfo struct {
}
type rebuiltNodeIndex struct {
+ // idToTree contains this tree, and all of its ancestor trees.
+ idToTree map[btrfsprim.ObjID]*RebuiltTree
+
// nodeToRoots contains all nodes in the filesystem that pass
// .isOwnerOK, whether or not they're in the tree.
nodeToRoots map[btrfsvol.LogicalAddr]rebuiltRoots
@@ -108,6 +111,7 @@ func (tree *RebuiltTree) uncachedNodeIndex(ctx context.Context) rebuiltNodeIndex
}
ret := rebuiltNodeIndex{
+ idToTree: indexer.idToTree,
nodeToRoots: make(map[btrfsvol.LogicalAddr]rebuiltRoots),
}
for node, roots := range indexer.run(ctx) {