Expand description
Inline data reading.
Spec: kernel.org/doc/html/latest/filesystems/ext4/inlinedata.html
When the INCOMPAT_INLINE_DATA feature is enabled and an inode has the
EXT4_INLINE_DATA_FL flag, the file’s contents live inside the inode
itself instead of being stored in extent-allocated data blocks.
Layout:
- First 60 bytes of the file are stored in the
i_block[60]array (the same field that normally holds the extent header / direct block pointers). - If the file is larger than 60 bytes, the remainder is stored as the
value of a special xattr named
system.data. Concatenate the two to get the full file content. - Maximum inline file size = 60 + (in-inode-xattr-region-size minus headers and other entries). Typically 60–~150 bytes for inode_size=256.
Functions§
- read_
all - Read the contents of an inline-data file in full.
- read_
range - Read a range from an inline-data file.
Returns the bytes copied into
dst, orOk(0)ifoffset >= size.