sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget%/translations/zh_CN/filesystems/erofsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/zh_TW/filesystems/erofsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/it_IT/filesystems/erofsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ja_JP/filesystems/erofsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ko_KR/filesystems/erofsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/sp_SP/filesystems/erofsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh?/var/lib/git/docbuild/linux/Documentation/filesystems/erofs.rsthKubhsection)}(hhh](htitle)}(h&EROFS - Enhanced Read-Only File Systemh]h&EROFS - Enhanced Read-Only File System}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hOverviewh]hOverview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXEROFS filesystem stands for Enhanced Read-Only File System. It aims to form a generic read-only filesystem solution for various read-only use cases instead of just focusing on storage space saving without considering any side effects of runtime performance.h]hXEROFS filesystem stands for Enhanced Read-Only File System. It aims to form a generic read-only filesystem solution for various read-only use cases instead of just focusing on storage space saving without considering any side effects of runtime performance.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hX/It is designed to meet the needs of flexibility, feature extendability and user payload friendly, etc. Apart from those, it is still kept as a simple random-access friendly high-performance filesystem to get rid of unneeded I/O amplification and memory-resident overhead compared to similar approaches.h]hX/It is designed to meet the needs of flexibility, feature extendability and user payload friendly, etc. Apart from those, it is still kept as a simple random-access friendly high-performance filesystem to get rid of unneeded I/O amplification and memory-resident overhead compared to similar approaches.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hDIt is implemented to be a better choice for the following scenarios:h]hDIt is implemented to be a better choice for the following scenarios:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hX- read-only storage media or - part of a fully trusted read-only solution, which means it needs to be immutable and bit-for-bit identical to the official golden image for their releases due to security or other considerations and - hope to minimize extra storage space with guaranteed end-to-end performance by using compact layout, transparent file compression and direct access, especially for those embedded devices with limited memory and high-density hosts with numerous containers. h]h bullet_list)}(hhh](h list_item)}(hread-only storage media or h]h)}(hread-only storage media orh]hread-only storage media or}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hpart of a fully trusted read-only solution, which means it needs to be immutable and bit-for-bit identical to the official golden image for their releases due to security or other considerations and h]h)}(hpart of a fully trusted read-only solution, which means it needs to be immutable and bit-for-bit identical to the official golden image for their releases due to security or other considerations andh]hpart of a fully trusted read-only solution, which means it needs to be immutable and bit-for-bit identical to the official golden image for their releases due to security or other considerations and}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj+ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hXhope to minimize extra storage space with guaranteed end-to-end performance by using compact layout, transparent file compression and direct access, especially for those embedded devices with limited memory and high-density hosts with numerous containers. h]h)}(hhope to minimize extra storage space with guaranteed end-to-end performance by using compact layout, transparent file compression and direct access, especially for those embedded devices with limited memory and high-density hosts with numerous containers.h]hhope to minimize extra storage space with guaranteed end-to-end performance by using compact layout, transparent file compression and direct access, especially for those embedded devices with limited memory and high-density hosts with numerous containers.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjCubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet-uh1j hhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhhhhubh)}(h$Here are the main features of EROFS:h]h$Here are the main features of EROFS:}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hhhhubj)}(hX- Little endian on-disk design; - Block-based distribution and file-based distribution over fscache are supported; - Support multiple devices to refer to external blobs, which can be used for container images; - 32-bit block addresses for each device, therefore 16TiB address space at most with 4KiB block size for now; - Two inode layouts for different requirements: ===================== ============ ====================================== compact (v1) extended (v2) ===================== ============ ====================================== Inode metadata size 32 bytes 64 bytes Max file size 4 GiB 16 EiB (also limited by max. vol size) Max uids/gids 65536 4294967296 Per-inode timestamp no yes (64 + 32-bit timestamp) Max hardlinks 65536 4294967296 Metadata reserved 8 bytes 18 bytes ===================== ============ ====================================== - Support extended attributes as an option; - Support a bloom filter that speeds up negative extended attribute lookups; - Support POSIX.1e ACLs by using extended attributes; - Support transparent data compression as an option: LZ4, MicroLZMA and DEFLATE algorithms can be used on a per-file basis; In addition, inplace decompression is also supported to avoid bounce compressed buffers and unnecessary page cache thrashing. - Support chunk-based data deduplication and rolling-hash compressed data deduplication; - Support tailpacking inline compared to byte-addressed unaligned metadata or smaller block size alternatives; - Support merging tail-end data into a special inode as fragments. - Support large folios to make use of THPs (Transparent Hugepages); - Support direct I/O on uncompressed files to avoid double caching for loop devices; - Support FSDAX on uncompressed images for secure containers and ramdisks in order to get rid of unnecessary page cache. - Support file-based on-demand loading with the Fscache infrastructure. h]j )}(hhh](j)}(hLittle endian on-disk design; h]h)}(hLittle endian on-disk design;h]hLittle endian on-disk design;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hj~ubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hQBlock-based distribution and file-based distribution over fscache are supported; h]h)}(hPBlock-based distribution and file-based distribution over fscache are supported;h]hPBlock-based distribution and file-based distribution over fscache are supported;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(h]Support multiple devices to refer to external blobs, which can be used for container images; h]h)}(h\Support multiple devices to refer to external blobs, which can be used for container images;h]h\Support multiple devices to refer to external blobs, which can be used for container images;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hl32-bit block addresses for each device, therefore 16TiB address space at most with 4KiB block size for now; h]h)}(hk32-bit block addresses for each device, therefore 16TiB address space at most with 4KiB block size for now;h]hk32-bit block addresses for each device, therefore 16TiB address space at most with 4KiB block size for now;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hXTwo inode layouts for different requirements: ===================== ============ ====================================== compact (v1) extended (v2) ===================== ============ ====================================== Inode metadata size 32 bytes 64 bytes Max file size 4 GiB 16 EiB (also limited by max. vol size) Max uids/gids 65536 4294967296 Per-inode timestamp no yes (64 + 32-bit timestamp) Max hardlinks 65536 4294967296 Metadata reserved 8 bytes 18 bytes ===================== ============ ====================================== h](h)}(h-Two inode layouts for different requirements:h]h-Two inode layouts for different requirements:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK&uh1jhjubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h}(h]h ]h"]h$]h&]uh1j$hj!ubj%)}(hhh]h}(h]h ]h"]h$]h&]uh1j$hj!ubj%)}(hhh]h}(h]h ]h"]h$]h&]uh1j$hj!ubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubhtbody)}(hhh](j )}(hhh](j%)}(hhh]h)}(hInode metadata sizeh]hInode metadata size}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjUubah}(h]h ]h"]h$]h&]uh1j$hjRubj%)}(hhh]h)}(h32 bytesh]h32 bytes}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjlubah}(h]h ]h"]h$]h&]uh1j$hjRubj%)}(hhh]h)}(h64 bytesh]h64 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1j$hjRubeh}(h]h ]h"]h$]h&]uh1jhjOubj )}(hhh](j%)}(hhh]h)}(h Max file sizeh]h Max file size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h4 GiBh]h4 GiB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h&16 EiB (also limited by max. vol size)h]h&16 EiB (also limited by max. vol size)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhjOubj )}(hhh](j%)}(hhh]h)}(h Max uids/gidsh]h Max uids/gids}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h65536h]h65536}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h 4294967296h]h 4294967296}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhjOubj )}(hhh](j%)}(hhh]h)}(hPer-inode timestamph]hPer-inode timestamp}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hj?ubah}(h]h ]h"]h$]h&]uh1j$hj<ubj%)}(hhh]h)}(hnoh]hno}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjVubah}(h]h ]h"]h$]h&]uh1j$hj<ubj%)}(hhh]h)}(hyes (64 + 32-bit timestamp)h]hyes (64 + 32-bit timestamp)}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjmubah}(h]h ]h"]h$]h&]uh1j$hj<ubeh}(h]h ]h"]h$]h&]uh1jhjOubj )}(hhh](j%)}(hhh]h)}(h Max hardlinksh]h Max hardlinks}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h65536h]h65536}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h 4294967296h]h 4294967296}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhjOubj )}(hhh](j%)}(hhh]h)}(hMetadata reservedh]hMetadata reserved}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h18 bytesh]h18 bytes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hj ubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhjOubeh}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj{ubj)}(h*Support extended attributes as an option; h]h)}(h)Support extended attributes as an option;h]h)Support extended attributes as an option;}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hj?ubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hKSupport a bloom filter that speeds up negative extended attribute lookups; h]h)}(hJSupport a bloom filter that speeds up negative extended attribute lookups;h]hJSupport a bloom filter that speeds up negative extended attribute lookups;}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK=hjWubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(h4Support POSIX.1e ACLs by using extended attributes; h]h)}(h3Support POSIX.1e ACLs by using extended attributes;h]h3Support POSIX.1e ACLs by using extended attributes;}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjoubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hSupport transparent data compression as an option: LZ4, MicroLZMA and DEFLATE algorithms can be used on a per-file basis; In addition, inplace decompression is also supported to avoid bounce compressed buffers and unnecessary page cache thrashing. h]h)}(hSupport transparent data compression as an option: LZ4, MicroLZMA and DEFLATE algorithms can be used on a per-file basis; In addition, inplace decompression is also supported to avoid bounce compressed buffers and unnecessary page cache thrashing.h]hSupport transparent data compression as an option: LZ4, MicroLZMA and DEFLATE algorithms can be used on a per-file basis; In addition, inplace decompression is also supported to avoid bounce compressed buffers and unnecessary page cache thrashing.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hWSupport chunk-based data deduplication and rolling-hash compressed data deduplication; h]h)}(hVSupport chunk-based data deduplication and rolling-hash compressed data deduplication;h]hVSupport chunk-based data deduplication and rolling-hash compressed data deduplication;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hmSupport tailpacking inline compared to byte-addressed unaligned metadata or smaller block size alternatives; h]h)}(hlSupport tailpacking inline compared to byte-addressed unaligned metadata or smaller block size alternatives;h]hlSupport tailpacking inline compared to byte-addressed unaligned metadata or smaller block size alternatives;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hASupport merging tail-end data into a special inode as fragments. h]h)}(h@Support merging tail-end data into a special inode as fragments.h]h@Support merging tail-end data into a special inode as fragments.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hBSupport large folios to make use of THPs (Transparent Hugepages); h]h)}(hASupport large folios to make use of THPs (Transparent Hugepages);h]hASupport large folios to make use of THPs (Transparent Hugepages);}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hSSupport direct I/O on uncompressed files to avoid double caching for loop devices; h]h)}(hRSupport direct I/O on uncompressed files to avoid double caching for loop devices;h]hRSupport direct I/O on uncompressed files to avoid double caching for loop devices;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hwSupport FSDAX on uncompressed images for secure containers and ramdisks in order to get rid of unnecessary page cache. h]h)}(hvSupport FSDAX on uncompressed images for secure containers and ramdisks in order to get rid of unnecessary page cache.h]hvSupport FSDAX on uncompressed images for secure containers and ramdisks in order to get rid of unnecessary page cache.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjubah}(h]h ]h"]h$]h&]uh1jhj{ubj)}(hFSupport file-based on-demand loading with the Fscache infrastructure. h]h)}(hESupport file-based on-demand loading with the Fscache infrastructure.h]hESupport file-based on-demand loading with the Fscache infrastructure.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhj/ubah}(h]h ]h"]h$]h&]uh1jhj{ubeh}(h]h ]h"]h$]h&]jajbuh1j hhhK#hjwubah}(h]h ]h"]h$]h&]uh1jhhhK#hhhhubh)}(hThe following git tree provides the file system user-space tools under development, such as a formatting tool (mkfs.erofs), an on-disk consistency & compatibility checking tool (fsck.erofs), and a debugging tool (dump.erofs):h]hThe following git tree provides the file system user-space tools under development, such as a formatting tool (mkfs.erofs), an on-disk consistency & compatibility checking tool (fsck.erofs), and a debugging tool (dump.erofs):}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhhhhubj )}(hhh]j)}(hDgit://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git h]h)}(hCgit://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.gith]hCgit://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjdubah}(h]h ]h"]h$]h&]uh1jhjahhhhhNubah}(h]h ]h"]h$]h&]jajbuh1j hhhK\hhhhubh)}(hBFor more information, please also refer to the documentation site:h]hBFor more information, please also refer to the documentation site:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hhhhubj )}(hhh]j)}(hhttps://erofs.docs.kernel.org h]h)}(hhttps://erofs.docs.kernel.orgh]h reference)}(hjh]hhttps://erofs.docs.kernel.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhK`hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubah}(h]h ]h"]h$]h&]jajbuh1j hhhK`hhhhubh)}(hgBugs and patches are welcome, please kindly help us and send to the following linux-erofs mailing list:h]hgBugs and patches are welcome, please kindly help us and send to the following linux-erofs mailing list:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhhhhubj )}(hhh]j)}(h:linux-erofs mailing list h]h)}(h9linux-erofs mailing list h](hlinux-erofs mailing list <}(hjhhhNhNubj)}(hlinux-erofs@lists.ozlabs.orgh]hlinux-erofs@lists.ozlabs.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refuri#mailto:linux-erofs@lists.ozlabs.orguh1jhjubh>}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubah}(h]h ]h"]h$]h&]jajbuh1j hhhKehhhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Mount optionsh]h Mount options}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK>uh1jhjubjN)}(hhh](j )}(hhh](j%)}(hhh]h)}(h(no)user_xattrh]h(no)user_xattr}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhj9ubah}(h]h ]h"]h$]h&]uh1j$hj6ubj%)}(hhh]h)}(hgSetup Extended User Attributes. Note: xattr is enabled by default if CONFIG_EROFS_FS_XATTR is selected.h]hgSetup Extended User Attributes. Note: xattr is enabled by default if CONFIG_EROFS_FS_XATTR is selected.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjPubah}(h]h ]h"]h$]h&]uh1j$hj6ubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(h(no)aclh]h(no)acl}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjpubah}(h]h ]h"]h$]h&]uh1j$hjmubj%)}(hhh]h)}(hjSetup POSIX Access Control List. Note: acl is enabled by default if CONFIG_EROFS_FS_POSIX_ACL is selected.h]hjSetup POSIX Access Control List. Note: acl is enabled by default if CONFIG_EROFS_FS_POSIX_ACL is selected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1j$hjmubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(hcache_strategy=%sh]hcache_strategy=%s}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh](h)}(h7Select a strategy for cached decompression from now on:h]h7Select a strategy for cached decompression from now on:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK-uh1jhjubjN)}(hhh](j )}(hhh](j%)}(hhh]h)}(hdisabledh]hdisabled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h In-place I/O decompression only;h]h In-place I/O decompression only;}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhjubj )}(hhh](j%)}(hhh]h)}(h readaheadh]h readahead}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshj&ubah}(h]h ]h"]h$]h&]uh1j$hj#ubj%)}(hhh]h)}(hCache the last incomplete compressed physical cluster for further reading. It still does in-place I/O decompression for the rest compressed physical clusters;h]hCache the last incomplete compressed physical cluster for further reading. It still does in-place I/O decompression for the rest compressed physical clusters;}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshj=ubah}(h]h ]h"]h$]h&]uh1j$hj#ubeh}(h]h ]h"]h$]h&]uh1jhjubj )}(hhh](j%)}(hhh]h)}(h readaroundh]h readaround}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhj]ubah}(h]h ]h"]h$]h&]uh1j$hjZubj%)}(hhh]h)}(hCache the both ends of incomplete compressed physical clusters for further reading. It still does in-place I/O decompression for the rest compressed physical clusters.h]hCache the both ends of incomplete compressed physical clusters for further reading. It still does in-place I/O decompression for the rest compressed physical clusters.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjtubah}(h]h ]h"]h$]h&]uh1j$hjZubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(hdax={always,never}h]hdax={always,never}}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(hJUse direct access (no page cache). See Documentation/filesystems/dax.rst.h]hJUse direct access (no page cache). See Documentation/filesystems/dax.rst.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(hdaxh]hdax}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h5A legacy option which is an alias for ``dax=always``.h](h&A legacy option which is an alias for }(hjhhhNhNubhliteral)}(h``dax=always``h]h dax=always}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK~hjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(h device=%sh]h device=%s}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5ubah}(h]h ]h"]h$]h&]uh1j$hj2ubj%)}(hhh]h)}(h6Specify a path to an extra device to be used together.h]h6Specify a path to an extra device to be used together.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjLubah}(h]h ]h"]h$]h&]uh1j$hj2ubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(hfsid=%sh]hfsid=%s}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjlubah}(h]h ]h"]h$]h&]uh1j$hjiubj%)}(hhh]h)}(h3Specify a filesystem image ID for Fscache back-end.h]h3Specify a filesystem image ID for Fscache back-end.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j$hjiubeh}(h]h ]h"]h$]h&]uh1jhj3ubj )}(hhh](j%)}(hhh]h)}(h domain_id=%sh]h domain_id=%s}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j$hjubj%)}(hhh]h)}(h{Specify a domain ID in fscache mode so that different images with the same blobs under a given domain ID can share storage.h]h{Specify a domain ID in fscache mode so that different images with the same blobs under a given domain ID can share storage.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j$hjubeh}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h] mount-optionsah ]h"] mount optionsah$]h&]uh1hhhhhhhhKhubh)}(hhh](h)}(h Sysfs Entriesh]h Sysfs Entries}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hInformation about mounted erofs file systems can be found in /sys/fs/erofs. Each mounted filesystem will have a directory in /sys/fs/erofs based on its device name (i.e., /sys/fs/erofs/sda). (see also Documentation/ABI/testing/sysfs-fs-erofs)h]hInformation about mounted erofs file systems can be found in /sys/fs/erofs. Each mounted filesystem will have a directory in /sys/fs/erofs based on its device name (i.e., /sys/fs/erofs/sda). (see also Documentation/ABI/testing/sysfs-fs-erofs)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] sysfs-entriesah ]h"] sysfs entriesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hOn-disk detailsh]hOn-disk details}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(hSummaryh]hSummary}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj* hhhhhKubh)}(hfDifferent from other read-only file systems, an EROFS volume is designed to be as simple as possible::h]heDifferent from other read-only file systems, an EROFS volume is designed to be as simple as possible:}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj* hhubh literal_block)}(h |-> aligned with the block size ____________________________________________________________ | |SB| | ... | Metadata | ... | Data | Metadata | ... | Data | |_|__|_|_____|__________|_____|______|__________|_____|______| 0 +1Kh]h |-> aligned with the block size ____________________________________________________________ | |SB| | ... | Metadata | ... | Data | Metadata | ... | Data | |_|__|_|_____|__________|_____|______|__________|_____|______| 0 +1K}hjK sbah}(h]h ]h"]h$]h&]hhuh1jI hhhKhj* hhubh)}(hAll data areas should be aligned with the block size, but metadata areas may not. All metadatas can be now observed in two different spaces (views):h]hAll data areas should be aligned with the block size, but metadata areas may not. All metadatas can be now observed in two different spaces (views):}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj* hhubj)}(hX1. Inode metadata space Each valid inode should be aligned with an inode slot, which is a fixed value (32 bytes) and designed to be kept in line with compact inode size. Each inode can be directly found with the following formula: inode offset = meta_blkaddr * block_size + 32 * nid :: |-> aligned with 8B |-> followed closely + meta_blkaddr blocks |-> another slot _____________________________________________________________________ | ... | inode | xattrs | extents | data inline | ... | inode ... |________|_______|(optional)|(optional)|__(optional)_|_____|__________ |-> aligned with the inode slot size . . . . . . . . . . . . .____________________________________________________|-> aligned with 4B | xattr_ibody_header | shared xattrs | inline xattrs | |____________________|_______________|_______________| |-> 12 bytes <-|->x * 4 bytes<-| . . . . . . . . . . ._______________________________.______________________. | id | id | id | id | ... | id | ent | ... | ent| ... | |____|____|____|____|______|____|_____|_____|____|_____| |-> aligned with 4B |-> aligned with 4B Inode could be 32 or 64 bytes, which can be distinguished from a common field which all inode versions have -- i_format:: __________________ __________________ | i_format | | i_format | |__________________| |__________________| | ... | | ... | | | | | |__________________| 32 bytes | | | | |__________________| 64 bytes Xattrs, extents, data inline are placed after the corresponding inode with proper alignment, and they could be optional for different data mappings. _currently_ total 5 data layouts are supported: == ==================================================================== 0 flat file data without data inline (no extent); 1 fixed-sized output data compression (with non-compacted indexes); 2 flat file data with tail packing data inline (no extent); 3 fixed-sized output data compression (with compacted indexes, v5.3+); 4 chunk-based file (v5.15+). == ==================================================================== The size of the optional xattrs is indicated by i_xattr_count in inode header. Large xattrs or xattrs shared by many different files can be stored in shared xattrs metadata rather than inlined right after inode. 2. Shared xattrs metadata space Shared xattrs space is similar to the above inode space, started with a specific block indicated by xattr_blkaddr, organized one by one with proper align. Each share xattr can also be directly found by the following formula: xattr offset = xattr_blkaddr * block_size + 4 * xattr_id h]henumerated_list)}(hhh](j)}(hX Inode metadata space Each valid inode should be aligned with an inode slot, which is a fixed value (32 bytes) and designed to be kept in line with compact inode size. Each inode can be directly found with the following formula: inode offset = meta_blkaddr * block_size + 32 * nid :: |-> aligned with 8B |-> followed closely + meta_blkaddr blocks |-> another slot _____________________________________________________________________ | ... | inode | xattrs | extents | data inline | ... | inode ... |________|_______|(optional)|(optional)|__(optional)_|_____|__________ |-> aligned with the inode slot size . . . . . . . . . . . . .____________________________________________________|-> aligned with 4B | xattr_ibody_header | shared xattrs | inline xattrs | |____________________|_______________|_______________| |-> 12 bytes <-|->x * 4 bytes<-| . . . . . . . . . . ._______________________________.______________________. | id | id | id | id | ... | id | ent | ... | ent| ... | |____|____|____|____|______|____|_____|_____|____|_____| |-> aligned with 4B |-> aligned with 4B Inode could be 32 or 64 bytes, which can be distinguished from a common field which all inode versions have -- i_format:: __________________ __________________ | i_format | | i_format | |__________________| |__________________| | ... | | ... | | | | | |__________________| 32 bytes | | | | |__________________| 64 bytes Xattrs, extents, data inline are placed after the corresponding inode with proper alignment, and they could be optional for different data mappings. _currently_ total 5 data layouts are supported: == ==================================================================== 0 flat file data without data inline (no extent); 1 fixed-sized output data compression (with non-compacted indexes); 2 flat file data with tail packing data inline (no extent); 3 fixed-sized output data compression (with compacted indexes, v5.3+); 4 chunk-based file (v5.15+). == ==================================================================== The size of the optional xattrs is indicated by i_xattr_count in inode header. Large xattrs or xattrs shared by many different files can be stored in shared xattrs metadata rather than inlined right after inode. h](h)}(hInode metadata spaceh]hInode metadata space}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubh)}(hEach valid inode should be aligned with an inode slot, which is a fixed value (32 bytes) and designed to be kept in line with compact inode size.h]hEach valid inode should be aligned with an inode slot, which is a fixed value (32 bytes) and designed to be kept in line with compact inode size.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubhdefinition_list)}(hhh]hdefinition_list_item)}(hqEach inode can be directly found with the following formula: inode offset = meta_blkaddr * block_size + 32 * nid h](hterm)}(h aligned with 8B |-> followed closely + meta_blkaddr blocks |-> another slot _____________________________________________________________________ | ... | inode | xattrs | extents | data inline | ... | inode ... |________|_______|(optional)|(optional)|__(optional)_|_____|__________ |-> aligned with the inode slot size . . . . . . . . . . . . .____________________________________________________|-> aligned with 4B | xattr_ibody_header | shared xattrs | inline xattrs | |____________________|_______________|_______________| |-> 12 bytes <-|->x * 4 bytes<-| . . . . . . . . . . ._______________________________.______________________. | id | id | id | id | ... | id | ent | ... | ent| ... | |____|____|____|____|______|____|_____|_____|____|_____| |-> aligned with 4B |-> aligned with 4Bh]hX |-> aligned with 8B |-> followed closely + meta_blkaddr blocks |-> another slot _____________________________________________________________________ | ... | inode | xattrs | extents | data inline | ... | inode ... |________|_______|(optional)|(optional)|__(optional)_|_____|__________ |-> aligned with the inode slot size . . . . . . . . . . . . .____________________________________________________|-> aligned with 4B | xattr_ibody_header | shared xattrs | inline xattrs | |____________________|_______________|_______________| |-> 12 bytes <-|->x * 4 bytes<-| . . . . . . . . . . ._______________________________.______________________. | id | id | id | id | ... | id | ent | ... | ent| ... | |____|____|____|____|______|____|_____|_____|____|_____| |-> aligned with 4B |-> aligned with 4B}hj sbah}(h]h ]h"]h$]h&]hhuh1jI hhhKhjp ubh)}(hyInode could be 32 or 64 bytes, which can be distinguished from a common field which all inode versions have -- i_format::h]hxInode could be 32 or 64 bytes, which can be distinguished from a common field which all inode versions have -- i_format:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubjJ )}(hX __________________ __________________ | i_format | | i_format | |__________________| |__________________| | ... | | ... | | | | | |__________________| 32 bytes | | | | |__________________| 64 bytesh]hX __________________ __________________ | i_format | | i_format | |__________________| |__________________| | ... | | ... | | | | | |__________________| 32 bytes | | | | |__________________| 64 bytes}hj sbah}(h]h ]h"]h$]h&]hhuh1jI hhhKhjp ubh)}(hXattrs, extents, data inline are placed after the corresponding inode with proper alignment, and they could be optional for different data mappings. _currently_ total 5 data layouts are supported:h]hXattrs, extents, data inline are placed after the corresponding inode with proper alignment, and they could be optional for different data mappings. _currently_ total 5 data layouts are supported:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKDuh1jhj ubjN)}(hhh](j )}(hhh](j%)}(hhh]h)}(h0h]h0}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj( ubah}(h]h ]h"]h$]h&]uh1j$hj% ubj%)}(hhh]h)}(h/flat file data without data inline (no extent);h]h/flat file data without data inline (no extent);}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj? ubah}(h]h ]h"]h$]h&]uh1j$hj% ubeh}(h]h ]h"]h$]h&]uh1jhj" ubj )}(hhh](j%)}(hhh]h)}(h1h]h1}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_ ubah}(h]h ]h"]h$]h&]uh1j$hj\ ubj%)}(hhh]h)}(hAfixed-sized output data compression (with non-compacted indexes);h]hAfixed-sized output data compression (with non-compacted indexes);}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjv ubah}(h]h ]h"]h$]h&]uh1j$hj\ ubeh}(h]h ]h"]h$]h&]uh1jhj" ubj )}(hhh](j%)}(hhh]h)}(h2h]h2}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubj%)}(hhh]h)}(h9flat file data with tail packing data inline (no extent);h]h9flat file data with tail packing data inline (no extent);}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubeh}(h]h ]h"]h$]h&]uh1jhj" ubj )}(hhh](j%)}(hhh]h)}(h3h]h3}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubj%)}(hhh]h)}(hDfixed-sized output data compression (with compacted indexes, v5.3+);h]hDfixed-sized output data compression (with compacted indexes, v5.3+);}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubeh}(h]h ]h"]h$]h&]uh1jhj" ubj )}(hhh](j%)}(hhh]h)}(h4h]h4}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubj%)}(hhh]h)}(hchunk-based file (v5.15+).h]hchunk-based file (v5.15+).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j$hj ubeh}(h]h ]h"]h$]h&]uh1jhj" ubeh}(h]h ]h"]h$]h&]uh1jMhj ubeh}(h]h ]h"]h$]h&]colsKuh1jhj ubah}(h]h ]h"]h$]h&]uh1jhjp ubh)}(hThe size of the optional xattrs is indicated by i_xattr_count in inode header. Large xattrs or xattrs shared by many different files can be stored in shared xattrs metadata rather than inlined right after inode.h]hThe size of the optional xattrs is indicated by i_xattr_count in inode header. Large xattrs or xattrs shared by many different files can be stored in shared xattrs metadata rather than inlined right after inode.}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjp ubeh}(h]h ]h"]h$]h&]uh1jhjm ubj)}(hX>Shared xattrs metadata space Shared xattrs space is similar to the above inode space, started with a specific block indicated by xattr_blkaddr, organized one by one with proper align. Each share xattr can also be directly found by the following formula: xattr offset = xattr_blkaddr * block_size + 4 * xattr_id h](h)}(hShared xattrs metadata spaceh]hShared xattrs metadata space}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_ ubh)}(hShared xattrs space is similar to the above inode space, started with a specific block indicated by xattr_blkaddr, organized one by one with proper align.h]hShared xattrs space is similar to the above inode space, started with a specific block indicated by xattr_blkaddr, organized one by one with proper align.}(hjq hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_ ubj )}(hhh]j )}(hEach share xattr can also be directly found by the following formula: xattr offset = xattr_blkaddr * block_size + 4 * xattr_id h](j )}(hEEach share xattr can also be directly found by the following formula:h]hEEach share xattr can also be directly found by the following formula:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hhhKhj ubj )}(hhh]h)}(h8xattr offset = xattr_blkaddr * block_size + 4 * xattr_idh]h8xattr offset = xattr_blkaddr * block_size + 4 * xattr_id}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj_ ubeh}(h]h ]h"]h$]h&]uh1jhjm ubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jk hjg ubah}(h]h ]h"]h$]h&]uh1jhhhKhj* hhubjJ )}(hXT |-> aligned by 4 bytes + xattr_blkaddr blocks |-> aligned with 4 bytes _________________________________________________________________________ | ... | xattr_entry | xattr data | ... | xattr_entry | xattr data ... |________|_____________|_____________|_____|______________|_______________h]hXT |-> aligned by 4 bytes + xattr_blkaddr blocks |-> aligned with 4 bytes _________________________________________________________________________ | ... | xattr_entry | xattr data | ... | xattr_entry | xattr data ... |________|_____________|_____________|_____|______________|_______________}hj sbah}(h]h ]h"]h$]h&]hhuh1jI hhhKhj* hhubeh}(h]summaryah ]h"]summaryah$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(h Directoriesh]h Directories}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXXAll directories are now organized in a compact on-disk format. Note that each directory block is divided into index and name areas in order to support random file lookup, and all directory entries are _strictly_ recorded in alphabetical order in order to support improved prefix binary search algorithm (could refer to the related source code).h]hXXAll directories are now organized in a compact on-disk format. Note that each directory block is divided into index and name areas in order to support random file lookup, and all directory entries are _strictly_ recorded in alphabetical order in order to support improved prefix binary search algorithm (could refer to the related source code).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjJ )}(hX ___________________________ / | / ______________|________________ / / | nameoff1 | nameoffN-1 ____________.______________._______________v________________v__________ | dirent | dirent | ... | dirent | filename | filename | ... | filename | |___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____| \ ^ \ | * could have \ | trailing '\0' \________________________| nameoff0 Directory blockh]hX ___________________________ / | / ______________|________________ / / | nameoff1 | nameoffN-1 ____________.______________._______________v________________v__________ | dirent | dirent | ... | dirent | filename | filename | ... | filename | |___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____| \ ^ \ | * could have \ | trailing '\0' \________________________| nameoff0 Directory block}hj sbah}(h]h ]h"]h$]h&]hhuh1jI hhhKhj hhubh)}(hNote that apart from the offset of the first filename, nameoff0 also indicates the total number of directory entries in this block since it is no need to introduce another on-disk field at all.h]hNote that apart from the offset of the first filename, nameoff0 also indicates the total number of directory entries in this block since it is no need to introduce another on-disk field at all.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h] directoriesah ]h"] directoriesah$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(hChunk-based filesh]hChunk-based files}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj' hhhhhM ubh)}(hXIn order to support chunk-based data deduplication, a new inode data layout has been supported since Linux v5.15: Files are split in equal-sized data chunks with ``extents`` area of the inode metadata indicating how to get the chunk data: these can be simply as a 4-byte block address array or in the 8-byte chunk index form (see struct erofs_inode_chunk_index in erofs_fs.h for more details.)h](hIn order to support chunk-based data deduplication, a new inode data layout has been supported since Linux v5.15: Files are split in equal-sized data chunks with }(hj8 hhhNhNubj )}(h ``extents``h]hextents}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj8 ubh area of the inode metadata indicating how to get the chunk data: these can be simply as a 4-byte block address array or in the 8-byte chunk index form (see struct erofs_inode_chunk_index in erofs_fs.h for more details.)}(hj8 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj' hhubh)}(h;By the way, chunk-based files are all uncompressed for now.h]h;By the way, chunk-based files are all uncompressed for now.}(hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubeh}(h]chunk-based-filesah ]h"]chunk-based filesah$]h&]uh1hhj hhhhhM ubh)}(hhh](h)}(h%Long extended attribute name prefixesh]h%Long extended attribute name prefixes}(hjq hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjn hhhhhMubh)}(hThere are use cases where extended attributes with different values can have only a few common prefixes (such as overlayfs xattrs). The predefined prefixes work inefficiently in both image size and runtime performance in such cases.h]hThere are use cases where extended attributes with different values can have only a few common prefixes (such as overlayfs xattrs). The predefined prefixes work inefficiently in both image size and runtime performance in such cases.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjn hhubh)}(hThe long xattr name prefixes feature is introduced to address this issue. The overall idea is that, apart from the existing predefined prefixes, the xattr entry could also refer to user-specified long xattr name prefixes, e.g. "trusted.overlay.".h]hThe long xattr name prefixes feature is introduced to address this issue. The overall idea is that, apart from the existing predefined prefixes, the xattr entry could also refer to user-specified long xattr name prefixes, e.g. “trusted.overlay.”.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjn hhubh)}(hXWhen referring to a long xattr name prefix, the highest bit (bit 7) of erofs_xattr_entry.e_name_index is set, while the lower bits (bit 0-6) as a whole represent the index of the referred long name prefix among all long name prefixes. Therefore, only the trailing part of the name apart from the long xattr name prefix is stored in erofs_xattr_entry.e_name, which could be empty if the full xattr name matches exactly as its long xattr name prefix.h]hXWhen referring to a long xattr name prefix, the highest bit (bit 7) of erofs_xattr_entry.e_name_index is set, while the lower bits (bit 0-6) as a whole represent the index of the referred long name prefix among all long name prefixes. Therefore, only the trailing part of the name apart from the long xattr name prefix is stored in erofs_xattr_entry.e_name, which could be empty if the full xattr name matches exactly as its long xattr name prefix.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjn hhubh)}(hXAll long xattr prefixes are stored one by one in the packed inode as long as the packed inode is valid, or in the meta inode otherwise. The xattr_prefix_count (of the on-disk superblock) indicates the total number of long xattr name prefixes, while (xattr_prefix_start * 4) indicates the start offset of long name prefixes in the packed/meta inode. Note that, long extended attribute name prefixes are disabled if xattr_prefix_count is 0.h]hXAll long xattr prefixes are stored one by one in the packed inode as long as the packed inode is valid, or in the meta inode otherwise. The xattr_prefix_count (of the on-disk superblock) indicates the total number of long xattr name prefixes, while (xattr_prefix_start * 4) indicates the start offset of long name prefixes in the packed/meta inode. Note that, long extended attribute name prefixes are disabled if xattr_prefix_count is 0.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjn hhubh)}(hXEach long name prefix is stored in the format: ALIGN({__le16 len, data}, 4), where len represents the total size of the data part. The data part is actually represented by 'struct erofs_xattr_long_prefix', where base_index represents the index of the predefined xattr name prefix, e.g. EROFS_XATTR_INDEX_TRUSTED for "trusted.overlay." long name prefix, while the infix string keeps the string after stripping the short prefix, e.g. "overlay." for the example above.h]hXEach long name prefix is stored in the format: ALIGN({__le16 len, data}, 4), where len represents the total size of the data part. The data part is actually represented by ‘struct erofs_xattr_long_prefix’, where base_index represents the index of the predefined xattr name prefix, e.g. EROFS_XATTR_INDEX_TRUSTED for “trusted.overlay.” long name prefix, while the infix string keeps the string after stripping the short prefix, e.g. “overlay.” for the example above.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjn hhubeh}(h]%long-extended-attribute-name-prefixesah ]h"]%long extended attribute name prefixesah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hData compressionh]hData compression}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhM6ubh)}(hXEROFS implements fixed-sized output compression which generates fixed-sized compressed data blocks from variable-sized input in contrast to other existing fixed-sized input solutions. Relatively higher compression ratios can be gotten by using fixed-sized output compression since nowadays popular data compression algorithms are mostly LZ77-based and such fixed-sized output approach can be benefited from the historical dictionary (aka. sliding window).h]hXEROFS implements fixed-sized output compression which generates fixed-sized compressed data blocks from variable-sized input in contrast to other existing fixed-sized input solutions. Relatively higher compression ratios can be gotten by using fixed-sized output compression since nowadays popular data compression algorithms are mostly LZ77-based and such fixed-sized output approach can be benefited from the historical dictionary (aka. sliding window).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hj hhubh)}(hXIn details, original (uncompressed) data is turned into several variable-sized extents and in the meanwhile, compressed into physical clusters (pclusters). In order to record each variable-sized extent, logical clusters (lclusters) are introduced as the basic unit of compress indexes to indicate whether a new extent is generated within the range (HEAD) or not (NONHEAD). Lclusters are now fixed in block size, as illustrated below::h]hXIn details, original (uncompressed) data is turned into several variable-sized extents and in the meanwhile, compressed into physical clusters (pclusters). In order to record each variable-sized extent, logical clusters (lclusters) are introduced as the basic unit of compress indexes to indicate whether a new extent is generated within the range (HEAD) or not (NONHEAD). Lclusters are now fixed in block size, as illustrated below:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hj hhubjJ )}(hX |<- variable-sized extent ->|<- VLE ->| clusterofs clusterofs clusterofs | | | _________v_________________________________v_______________________v________ ... | . | | . | | . ... ____|____._________|______________|________.___ _|______________|__.________ |-> lcluster <-|-> lcluster <-|-> lcluster <-|-> lcluster <-| (HEAD) (NONHEAD) (HEAD) (NONHEAD) . . CBLKCNT . . . . . . . . _______._____________________________.______________._________________ ... | | | | ... _______|______________|______________|______________|_________________ |-> big pcluster <-|-> pcluster <-|h]hX |<- variable-sized extent ->|<- VLE ->| clusterofs clusterofs clusterofs | | | _________v_________________________________v_______________________v________ ... | . | | . | | . ... ____|____._________|______________|________.___ _|______________|__.________ |-> lcluster <-|-> lcluster <-|-> lcluster <-|-> lcluster <-| (HEAD) (NONHEAD) (HEAD) (NONHEAD) . . CBLKCNT . . . . . . . . _______._____________________________.______________._________________ ... | | | | ... _______|______________|______________|______________|_________________ |-> big pcluster <-|-> pcluster <-|}hj sbah}(h]h ]h"]h$]h&]hhuh1jI hhhMEhj hhubh)}(hX A physical cluster can be seen as a container of physical compressed blocks which contains compressed data. Previously, only lcluster-sized (4KB) pclusters were supported. After big pcluster feature is introduced (available since Linux v5.13), pcluster can be a multiple of lcluster size.h]hX A physical cluster can be seen as a container of physical compressed blocks which contains compressed data. Previously, only lcluster-sized (4KB) pclusters were supported. After big pcluster feature is introduced (available since Linux v5.13), pcluster can be a multiple of lcluster size.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj hhubh)}(hXFor each HEAD lcluster, clusterofs is recorded to indicate where a new extent starts and blkaddr is used to seek the compressed data. For each NONHEAD lcluster, delta0 and delta1 are available instead of blkaddr to indicate the distance to its HEAD lcluster and the next HEAD lcluster. A PLAIN lcluster is also a HEAD lcluster except that its data is uncompressed. See the comments around "struct z_erofs_vle_decompressed_index" in erofs_fs.h for more details.h]hXFor each HEAD lcluster, clusterofs is recorded to indicate where a new extent starts and blkaddr is used to seek the compressed data. For each NONHEAD lcluster, delta0 and delta1 are available instead of blkaddr to indicate the distance to its HEAD lcluster and the next HEAD lcluster. A PLAIN lcluster is also a HEAD lcluster except that its data is uncompressed. See the comments around “struct z_erofs_vle_decompressed_index” in erofs_fs.h for more details.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhj hhubh)}(hX+If big pcluster is enabled, pcluster size in lclusters needs to be recorded as well. Let the delta0 of the first NONHEAD lcluster store the compressed block count with a special flag as a new called CBLKCNT NONHEAD lcluster. It's easy to understand its delta0 is constantly 1, as illustrated below::h]hX,If big pcluster is enabled, pcluster size in lclusters needs to be recorded as well. Let the delta0 of the first NONHEAD lcluster store the compressed block count with a special flag as a new called CBLKCNT NONHEAD lcluster. It’s easy to understand its delta0 is constantly 1, as illustrated below:}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahj hhubjJ )}(hX' __________________________________________________________ | HEAD | NONHEAD | NONHEAD | ... | NONHEAD | HEAD | HEAD | |__:___|_(CBLKCNT)_|_________|_____|_________|__:___|____:_| |<----- a big pcluster (with CBLKCNT) ------>|<-- -->| a lcluster-sized pcluster (without CBLKCNT) ^h]hX' __________________________________________________________ | HEAD | NONHEAD | NONHEAD | ... | NONHEAD | HEAD | HEAD | |__:___|_(CBLKCNT)_|_________|_____|_________|__:___|____:_| |<----- a big pcluster (with CBLKCNT) ------>|<-- -->| a lcluster-sized pcluster (without CBLKCNT) ^}hj2 sbah}(h]h ]h"]h$]h&]hhuh1jI hhhMfhj hhubh)}(hIf another HEAD follows a HEAD lcluster, there is no room to record CBLKCNT, but it's easy to know the size of such pcluster is 1 lcluster as well.h]hIf another HEAD follows a HEAD lcluster, there is no room to record CBLKCNT, but it’s easy to know the size of such pcluster is 1 lcluster as well.}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj hhubh)}(hSince Linux v6.1, each pcluster can be used for multiple variable-sized extents, therefore it can be used for compressed data deduplication.h]hSince Linux v6.1, each pcluster can be used for multiple variable-sized extents, therefore it can be used for compressed data deduplication.}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMohj hhubeh}(h]data-compressionah ]h"]data compressionah$]h&]uh1hhj hhhhhM6ubeh}(h]on-disk-detailsah ]h"]on-disk detailsah$]h&]uh1hhhhhhhhKubeh}(h]$erofs-enhanced-read-only-file-systemah ]h"]&erofs - enhanced read-only file systemah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj$footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jq jn jjjjj j ji jf j j j$ j! jk jh j j ja j^ u nametypes}(jq jjj ji j j$ jk j ja uh}(jn hjhjjj jjf j j j* j! j jh j' j jn j^ j u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.