summaryrefslogtreecommitdiff
path: root/lib/btrfs/types_node.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-07-15 21:13:46 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-07-15 21:13:46 -0600
commite1c2606daa740d70efc4e1bfade0513708ceed65 (patch)
treef8537e27f5c1dd1ab47736d3be7e951edb1b8de8 /lib/btrfs/types_node.go
parent5627aaea2c15a6fa8cca202614119f72972be37f (diff)
Let btree search have access to the item size
Diffstat (limited to 'lib/btrfs/types_node.go')
-rw-r--r--lib/btrfs/types_node.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/btrfs/types_node.go b/lib/btrfs/types_node.go
index 781b2fa..840236d 100644
--- a/lib/btrfs/types_node.go
+++ b/lib/btrfs/types_node.go
@@ -247,8 +247,9 @@ func (node *Node) marshalInternalTo(bodyBuf []byte) error {
// Node: "leaf" ////////////////////////////////////////////////////////////////////////////////////
type Item struct {
- Key Key
- Body btrfsitem.Item
+ Key Key
+ BodySize uint32 // [ignored-when-writing]
+ Body btrfsitem.Item
}
type ItemHeader struct {
@@ -287,8 +288,9 @@ func (node *Node) unmarshalLeaf(bodyBuf []byte) (int, error) {
dataBuf := bodyBuf[dataOff : dataOff+dataSize]
node.BodyLeaf = append(node.BodyLeaf, Item{
- Key: itemHead.Key,
- Body: btrfsitem.UnmarshalItem(itemHead.Key, node.ChecksumType, dataBuf),
+ Key: itemHead.Key,
+ BodySize: itemHead.DataSize,
+ Body: btrfsitem.UnmarshalItem(itemHead.Key, node.ChecksumType, dataBuf),
})
}