Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Enhanced Read-Only File System - EROFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) ======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) Overview
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) EROFS file-system stands for Enhanced Read-Only File System. Different
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) from other read-only file systems, it aims to be designed for flexibility,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) scalability, but be kept simple and high performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) It is designed as a better filesystem solution for the following scenarios:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  - read-only storage media or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  - part of a fully trusted read-only solution, which means it needs to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)    immutable and bit-for-bit identical to the official golden image for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)    their releases due to security and other considerations and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  - hope to save some extra storage space with guaranteed end-to-end performance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)    by using reduced metadata and transparent file compression, especially
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)    for those embedded devices with limited memory (ex, smartphone);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) Here is the main features of EROFS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  - Little endian on-disk design;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  - Currently 4KB block size (nobh) and therefore maximum 16TB address space;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  - Metadata & data could be mixed by design;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  - 2 inode versions for different requirements:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)    =====================  ============  =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)                           compact (v1)  extended (v2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)    =====================  ============  =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)    Inode metadata size    32 bytes      64 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)    Max file size          4 GB          16 EB (also limited by max. vol size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)    Max uids/gids          65536         4294967296
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)    File change time       no            yes (64 + 32-bit timestamp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)    Max hardlinks          65536         4294967296
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)    Metadata reserved      4 bytes       14 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)    =====================  ============  =====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  - Support extended attributes (xattrs) as an option;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  - Support xattr inline and tail-end data inline for all files;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  - Support POSIX.1e ACLs by using xattrs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  - Support transparent file compression as an option:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)    LZ4 algorithm with 4 KB fixed-sized output compression for high performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) The following git tree provides the file system user-space tools under
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) development (ex, formatting tool mkfs.erofs):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) - git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) Bugs and patches are welcome, please kindly help us and send to the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) linux-erofs mailing list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) - linux-erofs mailing list   <linux-erofs@lists.ozlabs.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) Mount options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) ===================    =========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) (no)user_xattr         Setup Extended User Attributes. Note: xattr is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)                        by default if CONFIG_EROFS_FS_XATTR is selected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) (no)acl                Setup POSIX Access Control List. Note: acl is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)                        by default if CONFIG_EROFS_FS_POSIX_ACL is selected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) cache_strategy=%s      Select a strategy for cached decompression from now on:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		       ==========  =============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)                          disabled  In-place I/O decompression only;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)                         readahead  Cache the last incomplete compressed physical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)                                    cluster for further reading. It still does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)                                    in-place I/O decompression for the rest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)                                    compressed physical clusters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)                        readaround  Cache the both ends of incomplete compressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)                                    physical clusters for further reading.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)                                    It still does in-place I/O decompression
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)                                    for the rest compressed physical clusters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		       ==========  =============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) dax={always,never}     Use direct access (no page cache).  See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)                        Documentation/filesystems/dax.rst.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) dax                    A legacy option which is an alias for ``dax=always``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) ===================    =========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) On-disk details
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) Summary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) Different from other read-only file systems, an EROFS volume is designed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) to be as simple as possible::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)                                 |-> aligned with the block size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)    ____________________________________________________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)   | |SB| | ... | Metadata | ... | Data | Metadata | ... | Data |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)   |_|__|_|_____|__________|_____|______|__________|_____|______|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)   0 +1K
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) All data areas should be aligned with the block size, but metadata areas
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) may not. All metadatas can be now observed in two different spaces (views):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  1. Inode metadata space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)     Each valid inode should be aligned with an inode slot, which is a fixed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)     value (32 bytes) and designed to be kept in line with compact inode size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)     Each inode can be directly found with the following formula:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)          inode offset = meta_blkaddr * block_size + 32 * nid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 				    |-> aligned with 8B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 					    |-> followed closely
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	+ meta_blkaddr blocks                                      |-> another slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	_____________________________________________________________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	|  ...   | inode |  xattrs  | extents  | data inline | ... | inode ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	|________|_______|(optional)|(optional)|__(optional)_|_____|__________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		|-> aligned with the inode slot size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		    .                   .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		    .                         .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		.                              .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		.                                    .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	    .                                         .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	    .                                              .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	.____________________________________________________|-> aligned with 4B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	| xattr_ibody_header | shared xattrs | inline xattrs |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	|____________________|_______________|_______________|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	|->    12 bytes    <-|->x * 4 bytes<-|               .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 			    .                .                 .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 			.                      .                   .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		.                           .                     .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	    ._______________________________.______________________.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	    | id | id | id | id |  ... | id | ent | ... | ent| ... |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	    |____|____|____|____|______|____|_____|_____|____|_____|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 					    |-> aligned with 4B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 							|-> aligned with 4B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)     Inode could be 32 or 64 bytes, which can be distinguished from a common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)     field which all inode versions have -- i_format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)         __________________               __________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)        |     i_format     |             |     i_format     |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)        |__________________|             |__________________|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)        |        ...       |             |        ...       |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)        |                  |             |                  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)        |__________________| 32 bytes    |                  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)                                         |                  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)                                         |__________________| 64 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)     Xattrs, extents, data inline are followed by the corresponding inode with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)     proper alignment, and they could be optional for different data mappings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)     _currently_ total 4 valid data mappings are supported:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)     ==  ====================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)      0  flat file data without data inline (no extent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)      1  fixed-sized output data compression (with non-compacted indexes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)      2  flat file data with tail packing data inline (no extent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)      3  fixed-sized output data compression (with compacted indexes, v5.3+).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)     ==  ====================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)     The size of the optional xattrs is indicated by i_xattr_count in inode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)     header. Large xattrs or xattrs shared by many different files can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)     stored in shared xattrs metadata rather than inlined right after inode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  2. Shared xattrs metadata space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)     Shared xattrs space is similar to the above inode space, started with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)     a specific block indicated by xattr_blkaddr, organized one by one with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)     proper align.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)     Each share xattr can also be directly found by the following formula:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)          xattr offset = xattr_blkaddr * block_size + 4 * xattr_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			    |-> aligned by  4 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	+ xattr_blkaddr blocks                     |-> aligned with 4 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	_________________________________________________________________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	|  ...   | xattr_entry |  xattr data | ... |  xattr_entry | xattr data  ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	|________|_____________|_____________|_____|______________|_______________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) Directories
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) All directories are now organized in a compact on-disk format. Note that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) each directory block is divided into index and name areas in order to support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) random file lookup, and all directory entries are _strictly_ recorded in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) alphabetical order in order to support improved prefix binary search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) algorithm (could refer to the related source code).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		    ___________________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		    /                           |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		/              ______________|________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 		/              /              | nameoff1       | nameoffN-1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)     ____________.______________._______________v________________v__________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)     | dirent | dirent | ... | dirent | filename | filename | ... | filename |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)     |___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	\                           ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	\                          |                           * could have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	\                         |                             trailing '\0'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	    \________________________| nameoff0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 				Directory block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) Note that apart from the offset of the first filename, nameoff0 also indicates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) the total number of directory entries in this block since it is no need to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) introduce another on-disk field at all.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) Compression
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) Currently, EROFS supports 4KB fixed-sized output transparent file compression,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) as illustrated below::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	    |---- Variant-Length Extent ----|-------- VLE --------|----- VLE -----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	    clusterofs                      clusterofs            clusterofs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	    |                               |                     |   logical data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)     _________v_______________________________v_____________________v_______________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)     ... |    .        |             |        .    |             |  .          | ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)     ____|____.________|_____________|________.____|_____________|__.__________|____
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	|-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	    size          size          size          size          size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	    .                             .                .                   .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	    .                       .               .                  .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		.                  .              .                .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	_______._____________._____________._____________._____________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	    ... |             |             |             | ... physical data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	_______|_____________|_____________|_____________|_____________________
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		|-> cluster <-|-> cluster <-|-> cluster <-|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 		    size          size          size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) Currently each on-disk physical cluster can contain 4KB (un)compressed data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) at most. For each logical cluster, there is a corresponding on-disk index to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) describe its cluster type, physical cluster address, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) See "struct z_erofs_vle_decompressed_index" in erofs_fs.h for more details.