From 01d7bcfc588c5551e8ac387f62d2fc4468ba1f4c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 7 Apr 2023 13:52:35 -0600 Subject: btrfsutil: RebuiltForrest: Allow skipping the .AddedItem loop --- lib/btrfsutil/rebuilt_forrest.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/btrfsutil/rebuilt_forrest.go') diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go index 29a5210..4249396 100644 --- a/lib/btrfsutil/rebuilt_forrest.go +++ b/lib/btrfsutil/rebuilt_forrest.go @@ -73,8 +73,11 @@ type RebuiltForrest struct { rebuiltSharedCache } -// NewRebuiltForrest returns a new RebuiltForrest instance. The -// RebuiltForrestCallbacks may be nil. +// NewRebuiltForrest returns a new RebuiltForrest instance. +// +// The `cb` RebuiltForrestCallbacks may be nil. If `cb` also +// implements RebuiltForrestExtendedCallbacks, then a series of +// .AddedItem() calls will be made before each call to .AddedRoot(). func NewRebuiltForrest(fs btrfs.ReadableFS, graph Graph, cb RebuiltForrestCallbacks) *RebuiltForrest { ret := &RebuiltForrest{ inner: fs, -- cgit v1.2.3-2-g168b