summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfstree
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfs/btrfstree')
-rw-r--r--lib/btrfs/btrfstree/ops.go2
-rw-r--r--lib/btrfs/btrfstree/root.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfs/btrfstree/ops.go b/lib/btrfs/btrfstree/ops.go
index cdacef9..bda4ac8 100644
--- a/lib/btrfs/btrfstree/ops.go
+++ b/lib/btrfs/btrfstree/ops.go
@@ -207,7 +207,7 @@ func (fs TreeOperatorImpl) treeWalk(ctx context.Context, path TreePath, errHandl
ToKey: item.Key,
ToMaxKey: item.Key,
})
- if errBody, isErr := item.Body.(btrfsitem.Error); isErr {
+ if errBody, isErr := item.Body.(*btrfsitem.Error); isErr {
if cbs.BadItem == nil {
errHandle(&TreeError{Path: itemPath, Err: errBody.Err})
} else {
diff --git a/lib/btrfs/btrfstree/root.go b/lib/btrfs/btrfstree/root.go
index 319904b..ace2b49 100644
--- a/lib/btrfs/btrfstree/root.go
+++ b/lib/btrfs/btrfstree/root.go
@@ -72,14 +72,14 @@ func LookupTreeRoot(fs TreeOperator, sb Superblock, treeID btrfsprim.ObjID) (*Tr
return nil, err
}
switch rootItemBody := rootItem.Body.(type) {
- case btrfsitem.Root:
+ case *btrfsitem.Root:
return &TreeRoot{
TreeID: treeID,
RootNode: rootItemBody.ByteNr,
Level: rootItemBody.Level,
Generation: rootItemBody.Generation,
}, nil
- case btrfsitem.Error:
+ case *btrfsitem.Error:
return nil, fmt.Errorf("malformed ROOT_ITEM for tree %v: %w", treeID, rootItemBody.Err)
default:
panic(fmt.Errorf("should not happen: ROOT_ITEM has unexpected item type: %T", rootItemBody))