diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-15 15:17:11 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-15 15:40:25 -0600 |
commit | 56e44b0630448d44f7aa7f85b2098007ddbae06f (patch) | |
tree | 2fef6ed9553472c9ff251c27c30ca7dcba16abcc /lib/btrfsutil/old_rebuilt_forrest.go | |
parent | 8387d36fac1f01505b37d90d675609460202310d (diff) |
btrfstree: Distinguish between tree-not-found and item-not-found
Diffstat (limited to 'lib/btrfsutil/old_rebuilt_forrest.go')
-rw-r--r-- | lib/btrfsutil/old_rebuilt_forrest.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/btrfsutil/old_rebuilt_forrest.go b/lib/btrfsutil/old_rebuilt_forrest.go index af2643a..4076072 100644 --- a/lib/btrfsutil/old_rebuilt_forrest.go +++ b/lib/btrfsutil/old_rebuilt_forrest.go @@ -7,7 +7,6 @@ package btrfsutil import ( "context" "fmt" - iofs "io/fs" "sync" "github.com/datawire/dlib/derror" @@ -226,7 +225,7 @@ func (bt *OldRebuiltForrest) TreeSearch(treeID btrfsprim.ObjID, fn func(btrfspri return fn(indexItem.Key, indexItem.ItemSize) }) if indexItem == nil { - return btrfstree.Item{}, bt.addErrs(tree, fn, iofs.ErrNotExist) + return btrfstree.Item{}, bt.addErrs(tree, fn, btrfstree.ErrNoItem) } itemPath := bt.arena.Inflate(indexItem.Value.Path) @@ -258,7 +257,7 @@ func (bt *OldRebuiltForrest) TreeSearchAll(treeID btrfsprim.ObjID, fn func(btrfs return true }) if len(indexItems) == 0 { - return nil, bt.addErrs(tree, fn, iofs.ErrNotExist) + return nil, bt.addErrs(tree, fn, btrfstree.ErrNoItem) } ret := make([]btrfstree.Item, len(indexItems)) |