From c9ca78f970f0b48fbf6965e8ec15f6b8f31ce485 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Apr 2023 11:23:03 -0600 Subject: btrfsutil: RebuiltForrest: readItem: Return a full btrfstree.Item --- lib/btrfsutil/rebuilt_callbacks.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/btrfsutil/rebuilt_callbacks.go') diff --git a/lib/btrfsutil/rebuilt_callbacks.go b/lib/btrfsutil/rebuilt_callbacks.go index 3a7e6e6..41fe7f1 100644 --- a/lib/btrfsutil/rebuilt_callbacks.go +++ b/lib/btrfsutil/rebuilt_callbacks.go @@ -48,9 +48,9 @@ func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfs if !ok { return 0, btrfsitem.Root{}, false } - itemBody := cb.forrest.readItem(ctx, itemPtr) - defer itemBody.Free() - switch itemBody := itemBody.(type) { + item := cb.forrest.readItem(ctx, itemPtr) + defer item.Body.Free() + switch itemBody := item.Body.(type) { case *btrfsitem.Root: return btrfsprim.Generation(itemKey.Offset), *itemBody, true case *btrfsitem.Error: @@ -73,9 +73,9 @@ func (cb noopRebuiltForrestCallbacks) LookupUUID(ctx context.Context, uuid btrfs if !ok { return 0, false } - itemBody := cb.forrest.readItem(ctx, itemPtr) - defer itemBody.Free() - switch itemBody := itemBody.(type) { + item := cb.forrest.readItem(ctx, itemPtr) + defer item.Body.Free() + switch itemBody := item.Body.(type) { case *btrfsitem.UUIDMap: return itemBody.ObjID, true case *btrfsitem.Error: -- cgit v1.2.3-2-g168b