diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-14 04:45:48 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-14 05:45:45 -0600 |
commit | bb73a2fb7678698353bb995754e8702caa2f6e0a (patch) | |
tree | 0ecd149e8ea61db883c7450accfacf42db08b82e /lib/btrfs/btrfsitem/item_fileextent.go | |
parent | ae42c45061e6e68ed2cdb455ba45a14c39f7cae7 (diff) |
wip ls-files
Diffstat (limited to 'lib/btrfs/btrfsitem/item_fileextent.go')
-rw-r--r-- | lib/btrfs/btrfsitem/item_fileextent.go | 24 |
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) { |