summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem/item_extentdataref.go
blob: 8c856e22f509a586ab0f7b853c28aafaa1d3ffe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2022  Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later

package btrfsitem

import (
	"git.lukeshu.com/btrfs-progs-ng/lib/binstruct"
	"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsprim"
)

// key.objectid = laddr of the extent being referenced
// key.offset = crc32c([root,objectid,offset])
type ExtentDataRef struct { // EXTENT_DATA_REF=178
	Root          btrfsprim.ObjID `bin:"off=0, siz=8"`  // subvolume tree ID that references this extent
	ObjectID      btrfsprim.ObjID `bin:"off=8, siz=8"`  // inode number that references this extent within the .Root subvolume
	Offset        int64           `bin:"off=16, siz=8"` // byte offset for the extent within the file
	Count         int32           `bin:"off=24, siz=4"` // reference count
	binstruct.End `bin:"off=28"`
}