summaryrefslogtreecommitdiff
path: root/lib/btrfsutil/rebuilt_callbacks.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfsutil/rebuilt_callbacks.go')
-rw-r--r--lib/btrfsutil/rebuilt_callbacks.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/btrfsutil/rebuilt_callbacks.go b/lib/btrfsutil/rebuilt_callbacks.go
index 9ed3177..b5fbc91 100644
--- a/lib/btrfsutil/rebuilt_callbacks.go
+++ b/lib/btrfsutil/rebuilt_callbacks.go
@@ -16,7 +16,7 @@ import (
type RebuiltForrestCallbacks interface {
AddedRoot(ctx context.Context, tree btrfsprim.ObjID, root btrfsvol.LogicalAddr)
- LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, item btrfsitem.Root, ok bool)
+ LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, item btrfsitem.Root, err error)
LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, err error)
}
@@ -32,21 +32,21 @@ type noopRebuiltForrestCallbacks struct {
func (noopRebuiltForrestCallbacks) AddedRoot(context.Context, btrfsprim.ObjID, btrfsvol.LogicalAddr) {
}
-func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, _item btrfsitem.Root, ok bool) {
+func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, _item btrfsitem.Root, err error) {
rootTree, err := cb.forrest.ForrestLookup(ctx, btrfsprim.ROOT_TREE_OBJECTID)
if err != nil {
- return 0, btrfsitem.Root{}, false
+ return 0, btrfsitem.Root{}, err
}
item, err := rootTree.TreeSearch(ctx, btrfstree.SearchRootItem(tree))
if err != nil {
- return 0, btrfsitem.Root{}, false
+ return 0, btrfsitem.Root{}, err
}
defer item.Body.Free()
switch itemBody := item.Body.(type) {
case *btrfsitem.Root:
- return btrfsprim.Generation(item.Key.Offset), *itemBody, true
+ return btrfsprim.Generation(item.Key.Offset), *itemBody, nil
case *btrfsitem.Error:
- return 0, btrfsitem.Root{}, false
+ return 0, btrfsitem.Root{}, itemBody.Err
default:
// This is a panic because the item decoder should not emit ROOT_ITEM items as anything but
// btrfsitem.Root or btrfsitem.Error without this code also being updated.