From 2bca1422067e0de0a5ec1b37c37f280e797a8072 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Apr 2023 18:34:00 -0600 Subject: btrfsutil: RebuiltForrest: Have the ancestor id-to-ptr map persist --- lib/btrfsutil/rebuilt_tree.go | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- cgit v1.2.3