summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem/item_fileextent.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-07-14 04:45:48 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-07-14 05:45:45 -0600
commitbb73a2fb7678698353bb995754e8702caa2f6e0a (patch)
tree0ecd149e8ea61db883c7450accfacf42db08b82e /lib/btrfs/btrfsitem/item_fileextent.go
parentae42c45061e6e68ed2cdb455ba45a14c39f7cae7 (diff)
wip ls-files
Diffstat (limited to 'lib/btrfs/btrfsitem/item_fileextent.go')
-rw-r--r--lib/btrfs/btrfsitem/item_fileextent.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/btrfs/btrfsitem/item_fileextent.go b/lib/btrfs/btrfsitem/item_fileextent.go
index a69c67a..b7e394e 100644
--- a/lib/btrfs/btrfsitem/item_fileextent.go
+++ b/lib/btrfs/btrfsitem/item_fileextent.go
@@ -28,20 +28,22 @@ type FileExtent struct { // EXTENT_DATA=108
binstruct.End `bin:"off=0x15"`
// only one of these, depending on .Type
- BodyInline []byte `bin:"-"` // .Type == FILE_EXTENT_INLINE
- BodyExtent struct { // .Type == FILE_EXTENT_REG or FILE_EXTENT_PREALLOC
- // Position and size of extent within the device
- DiskByteNr btrfsvol.LogicalAddr `bin:"off=0x0, siz=0x8"`
- DiskNumBytes btrfsvol.AddrDelta `bin:"off=0x8, siz=0x8"`
+ BodyInline []byte `bin:"-"` // .Type == FILE_EXTENT_INLINE
+ BodyExtent FileExtentExtent `bin:"-"` // .Type == FILE_EXTENT_REG or FILE_EXTENT_PREALLOC
+}
+
+type FileExtentExtent struct {
+ // Position and size of extent within the device
+ DiskByteNr btrfsvol.LogicalAddr `bin:"off=0x0, siz=0x8"`
+ DiskNumBytes btrfsvol.AddrDelta `bin:"off=0x8, siz=0x8"`
- // Position of data within the extent
- Offset btrfsvol.AddrDelta `bin:"off=0x10, siz=0x8"`
+ // Position of data within the extent
+ Offset btrfsvol.AddrDelta `bin:"off=0x10, siz=0x8"`
- // Decompressed/unencrypted size
- NumBytes int64 `bin:"off=0x18, siz=0x8"`
+ // Decompressed/unencrypted size
+ NumBytes int64 `bin:"off=0x18, siz=0x8"`
- binstruct.End `bin:"off=0x20"`
- } `bin:"-"`
+ binstruct.End `bin:"off=0x20"`
}
func (o *FileExtent) UnmarshalBinary(dat []byte) (int, error) {