Re: Rebuild mode for tail-pack layouts
Gao Xiang <[email protected]>
| Newsgroups | org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
Hi xtex,
On 2026/4/30 20:09, xtex wrote:
> Hi!
>
> In erofs_rebuild_write_blob_index (rebuild.c), only EROFS_INODE_CHUNK_BASED
> and FLAT_PLAIN are implemented, so when generating a metadata index with
> rebuild mode, the sources cannot use tail-pack nor inline data layout.
> However, disabling tail-packing can lead to great disk-space waste in many
> cases, especially when the file-system consists of a lot of small files.
>
> Thus I attempted to implement FLAT_INLINE for it, only to realize that the
> current chunk entry formats can only represent physical addresses that are
> block-aligned while tail-pack extent is not.
>
> I wonder what do you think about adding a new chunk entry format? And how
> should it be named?
>
> I would suggest the following structure:
> struct erofs_inode_chunk_index_tp {
> __le16 startblk_hi; /* starting block number MSB */
> __le16 device_id; /* back-end storage id (with bits masked)
> */
> __le32 startblk_lo; /* starting block number of this chunk */
> /* new fields below */
> __le16 startblk_off; /* starting block offset */
> __le16 reserved;
> } __packed;
> The 16b offset should be enough unless we are to support block size > 64K.
> The reserved field is added for alignment.
Sorry about the late response.
Thanks for the question.
FLAT_INLINE can be used for index rebuilding, which can work with
uniaddr (or mapped_blkaddr) since the blkaddr will be mapped
into the relative address based on the blob starting with
mapped_blkaddr:
https://erofs.docs.kernel.org/en/latest/ondisk/chunked_format.html#device-table
But I agree the expression in the page above is a bit
ambigious through.
Thanks,
Gao Xiang
>
> Best wishes.
>