diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-05 11:40:32 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-17 21:52:25 -0600 |
commit | 6630e28213a6c5f506d6a6d6f3e764a42c967163 (patch) | |
tree | fe11d0a83879bb3b11e8088bd4e1d18c9074edf7 /lib/btrfsutil/rebuilt_tree.go | |
parent | dc1eddc75a17687ee4d3bc301dd8b2ff253095fe (diff) |
btrfsutil: RebuiltForrest: Add a .RebuiltAddRoots() method, cmd/btrfs-rec: Add a --trees flag
Diffstat (limited to 'lib/btrfsutil/rebuilt_tree.go')
-rw-r--r-- | lib/btrfsutil/rebuilt_tree.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/btrfsutil/rebuilt_tree.go b/lib/btrfsutil/rebuilt_tree.go index 97308a3..f002ea6 100644 --- a/lib/btrfsutil/rebuilt_tree.go +++ b/lib/btrfsutil/rebuilt_tree.go @@ -700,6 +700,10 @@ func (tree *RebuiltTree) RebuiltAddRoot(ctx context.Context, rootNode btrfsvol.L tree.mu.Lock() defer tree.mu.Unlock() + if tree.Roots.Has(rootNode) { + return + } + ctx = dlog.WithField(ctx, "btrfs.util.rebuilt-tree.add-root", fmt.Sprintf("tree=%v rootNode=%v", tree.ID, rootNode)) dlog.Info(ctx, "adding root...") |