From 504c3695c7dae682504335a47e1f0f873f95ca30 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Apr 2023 15:26:48 -0600 Subject: btrfsutil: RebuiltForrest.RebuiltTree(): Return errors --- cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go') diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go index 0526e93..382d88b 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go @@ -43,8 +43,8 @@ func (o graphCallbacks) Want(ctx context.Context, reason string, treeID btrfspri } func (o *rebuilder) _want(ctx context.Context, wantKey wantWithTree) (key btrfsprim.Key, ok bool) { - tree := o.rebuilt.RebuiltTree(ctx, wantKey.TreeID) - if tree == nil { + tree, err := o.rebuilt.RebuiltTree(ctx, wantKey.TreeID) + if err != nil { o.enqueueRetry(wantKey.TreeID) return btrfsprim.Key{}, false } @@ -98,8 +98,8 @@ func (o graphCallbacks) WantOff(ctx context.Context, reason string, treeID btrfs } func (o *rebuilder) _wantOff(ctx context.Context, wantKey wantWithTree) (ok bool) { - tree := o.rebuilt.RebuiltTree(ctx, wantKey.TreeID) - if tree == nil { + tree, err := o.rebuilt.RebuiltTree(ctx, wantKey.TreeID) + if err != nil { o.enqueueRetry(wantKey.TreeID) return false } @@ -144,8 +144,8 @@ func (o graphCallbacks) WantDirIndex(ctx context.Context, reason string, treeID } ctx = withWant(ctx, logFieldItemWant, reason, wantKey) - tree := o.rebuilt.RebuiltTree(ctx, treeID) - if tree == nil { + tree, err := o.rebuilt.RebuiltTree(ctx, treeID) + if err != nil { o.enqueueRetry(treeID) return } @@ -273,8 +273,8 @@ func (o graphCallbacks) _wantRange( ctx = withWant(ctx, logFieldItemWant, reason, wantKey) wantKey.Key.OffsetType = offsetRange - tree := o.rebuilt.RebuiltTree(ctx, treeID) - if tree == nil { + tree, err := o.rebuilt.RebuiltTree(ctx, treeID) + if err != nil { o.enqueueRetry(treeID) return } @@ -389,7 +389,7 @@ func (o graphCallbacks) WantCSum(ctx context.Context, reason string, inodeTree, o.enqueueRetry(inodeTree) return } - tree := o.rebuilt.RebuiltTree(inodeCtx, inodeTree) + tree := discardErr(o.rebuilt.RebuiltTree(inodeCtx, inodeTree)) inodePtr, ok := tree.RebuiltAcquireItems(inodeCtx).Load(inodeWant.Key.Key()) tree.RebuiltReleaseItems() if !ok { -- cgit v1.2.3-2-g168b