summaryrefslogtreecommitdiff
path: root/lib/btrfsutil/rebuilt_readitem.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-04-14 07:19:45 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-14 07:19:45 -0600
commitc2c6fa42233cd3911b81bb9449329816f645cec5 (patch)
treec8d3663a5d1d03f033a0c133983061bc2ef61418 /lib/btrfsutil/rebuilt_readitem.go
parent163e8a157ab812a8eafa3a1d2d2b8c0e45431559 (diff)
parent9a63a26b4e23a8977a9558b7e9a79792eb5b6d18 (diff)
Merge branch 'lukeshu/rebuilt-v2-pt1-naive'
Diffstat (limited to 'lib/btrfsutil/rebuilt_readitem.go')
-rw-r--r--lib/btrfsutil/rebuilt_readitem.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/btrfsutil/rebuilt_readitem.go b/lib/btrfsutil/rebuilt_readitem.go
index d1d1319..e5faa45 100644
--- a/lib/btrfsutil/rebuilt_readitem.go
+++ b/lib/btrfsutil/rebuilt_readitem.go
@@ -8,7 +8,6 @@ import (
"context"
"fmt"
- "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsitem"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsprim"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfstree"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol"
@@ -24,7 +23,7 @@ func (ptr ItemPtr) String() string {
return fmt.Sprintf("node@%v[%v]", ptr.Node, ptr.Slot)
}
-func (ts *RebuiltForrest) readItem(ctx context.Context, ptr ItemPtr) btrfsitem.Item {
+func (ts *RebuiltForrest) readItem(ctx context.Context, ptr ItemPtr) btrfstree.Item {
graphInfo, ok := ts.graph.Nodes[ptr.Node]
if !ok {
panic(fmt.Errorf("should not happen: btrfsutil.RebuiltForrest.readItem called for node@%v not mentioned in the in-memory graph", ptr.Node))
@@ -62,5 +61,8 @@ func (ts *RebuiltForrest) readItem(ctx context.Context, ptr ItemPtr) btrfsitem.I
panic(fmt.Errorf("should not happen: btrfsutil.RebuiltForrest.readItem called for out-of-bounds item slot: slot=%v len=%v",
ptr.Slot, len(items)))
}
- return items[ptr.Slot].Body.CloneItem()
+
+ item := items[ptr.Slot]
+ item.Body = item.Body.CloneItem()
+ return item
}