Skip to contentSkip to conversation

Can a compressed file extent have non-zero offset?

DISCUSSION Marek Behun 1 participant 1 message Aug 29, 2017 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

I cannot find this in the documentation (and the sources are too long), so I am trying here:

can a file_extent_item with
item.type == BTRFS_FILE_EXTENT_REG
and
item.compression != BTRFS_COMPRESS_NONE

have non zero offset (item.offset != 0) ?

What does it mean in such a case? That compressed data start at 0, but in the uncompressed data, the data begin at item.offset? What does item.num_bytes in this case mean - the valid number of bytes from position item.offset, or the number of all bytes, even those before position item.offset?

Thank you.

Marek