diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-14 07:19:45 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-14 07:19:45 -0600 |
commit | c2c6fa42233cd3911b81bb9449329816f645cec5 (patch) | |
tree | c8d3663a5d1d03f033a0c133983061bc2ef61418 /cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go | |
parent | 163e8a157ab812a8eafa3a1d2d2b8c0e45431559 (diff) | |
parent | 9a63a26b4e23a8977a9558b7e9a79792eb5b6d18 (diff) |
Merge branch 'lukeshu/rebuilt-v2-pt1-naive'
Diffstat (limited to 'cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go')
-rw-r--r-- | cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go | 18 |
1 files changed, 9 insertions, 9 deletions
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 { |