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 0b51d08..9ed3177 100644
--- a/lib/btrfsutil/rebuilt_callbacks.go
+++ b/lib/btrfsutil/rebuilt_callbacks.go
@@ -17,7 +17,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)
- LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, ok bool)
+ LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, err error)
}
type RebuiltForrestExtendedCallbacks interface {
@@ -54,22 +54,22 @@ func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfs
}
}
-func (cb noopRebuiltForrestCallbacks) LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, ok bool) {
+func (cb noopRebuiltForrestCallbacks) LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btrfsprim.ObjID, err error) {
uuidTree, err := cb.forrest.ForrestLookup(ctx, btrfsprim.UUID_TREE_OBJECTID)
if err != nil {
- return 0, false
+ return 0, err
}
tgt := btrfsitem.UUIDToKey(uuid)
item, err := uuidTree.TreeLookup(ctx, tgt)
if err != nil {
- return 0, false
+ return 0, err
}
defer item.Body.Free()
switch itemBody := item.Body.(type) {
case *btrfsitem.UUIDMap:
- return itemBody.ObjID, true
+ return itemBody.ObjID, nil
case *btrfsitem.Error:
- return 0, false
+ return 0, itemBody.Err
default:
// This is a panic because the item decoder should not emit UUID_SUBVOL items as anything but
// btrfsitem.UUIDMap or btrfsitem.Error without this code also being updated.