1e66d8631SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0
2e66d8631SMauro Carvalho Chehab
3e66d8631SMauro Carvalho Chehab======================================
46e95d0a0SGao XiangEROFS - Enhanced Read-Only File System
5e66d8631SMauro Carvalho Chehab======================================
6e66d8631SMauro Carvalho Chehab
7e66d8631SMauro Carvalho ChehabOverview
8e66d8631SMauro Carvalho Chehab========
9e66d8631SMauro Carvalho Chehab
106e95d0a0SGao XiangEROFS filesystem stands for Enhanced Read-Only File System.  It aims to form a
116e95d0a0SGao Xianggeneric read-only filesystem solution for various read-only use cases instead
126e95d0a0SGao Xiangof just focusing on storage space saving without considering any side effects
136e95d0a0SGao Xiangof runtime performance.
14e66d8631SMauro Carvalho Chehab
156e95d0a0SGao XiangIt is designed to meet the needs of flexibility, feature extendability and user
166e95d0a0SGao Xiangpayload friendly, etc.  Apart from those, it is still kept as a simple
176e95d0a0SGao Xiangrandom-access friendly high-performance filesystem to get rid of unneeded I/O
186e95d0a0SGao Xiangamplification and memory-resident overhead compared to similar approaches.
196e95d0a0SGao Xiang
206e95d0a0SGao XiangIt is implemented to be a better choice for the following scenarios:
21e66d8631SMauro Carvalho Chehab
22e66d8631SMauro Carvalho Chehab - read-only storage media or
23e66d8631SMauro Carvalho Chehab
24e66d8631SMauro Carvalho Chehab - part of a fully trusted read-only solution, which means it needs to be
25e66d8631SMauro Carvalho Chehab   immutable and bit-for-bit identical to the official golden image for
266e95d0a0SGao Xiang   their releases due to security or other considerations and
27e66d8631SMauro Carvalho Chehab
28dfeab2e9SGao Xiang - hope to minimize extra storage space with guaranteed end-to-end performance
29dfeab2e9SGao Xiang   by using compact layout, transparent file compression and direct access,
30dfeab2e9SGao Xiang   especially for those embedded devices with limited memory and high-density
316e95d0a0SGao Xiang   hosts with numerous containers.
32e66d8631SMauro Carvalho Chehab
332109901dSGao XiangHere are the main features of EROFS:
34e66d8631SMauro Carvalho Chehab
35e66d8631SMauro Carvalho Chehab - Little endian on-disk design;
36e66d8631SMauro Carvalho Chehab
372109901dSGao Xiang - Block-based distribution and file-based distribution over fscache are
382109901dSGao Xiang   supported;
392109901dSGao Xiang
402109901dSGao Xiang - Support multiple devices to refer to external blobs, which can be used
412109901dSGao Xiang   for container images;
422109901dSGao Xiang
432109901dSGao Xiang - 4KiB block size and 32-bit block addresses for each device, therefore
442109901dSGao Xiang   16TiB address space at most for now;
45e66d8631SMauro Carvalho Chehab
466e95d0a0SGao Xiang - Two inode layouts for different requirements:
47e66d8631SMauro Carvalho Chehab
486e95d0a0SGao Xiang   =====================  ============  ======================================
49e66d8631SMauro Carvalho Chehab                          compact (v1)  extended (v2)
506e95d0a0SGao Xiang   =====================  ============  ======================================
51e66d8631SMauro Carvalho Chehab   Inode metadata size    32 bytes      64 bytes
526e95d0a0SGao Xiang   Max file size          4 GiB         16 EiB (also limited by max. vol size)
53e66d8631SMauro Carvalho Chehab   Max uids/gids          65536         4294967296
54a1108dcdSDavid Anderson   Per-inode timestamp    no            yes (64 + 32-bit timestamp)
55e66d8631SMauro Carvalho Chehab   Max hardlinks          65536         4294967296
566e95d0a0SGao Xiang   Metadata reserved      8 bytes       18 bytes
576e95d0a0SGao Xiang   =====================  ============  ======================================
586e95d0a0SGao Xiang
592109901dSGao Xiang - Support extended attributes as an option;
60e66d8631SMauro Carvalho Chehab
612109901dSGao Xiang - Support POSIX.1e ACLs by using extended attributes;
62e66d8631SMauro Carvalho Chehab
6346f2e044SGao Xiang - Support transparent data compression as an option:
646e95d0a0SGao Xiang   LZ4 and MicroLZMA algorithms can be used on a per-file basis; In addition,
656e95d0a0SGao Xiang   inplace decompression is also supported to avoid bounce compressed buffers
666e95d0a0SGao Xiang   and page cache thrashing.
67dfeab2e9SGao Xiang
682109901dSGao Xiang - Support chunk-based data deduplication and rolling-hash compressed data
692109901dSGao Xiang   deduplication;
702109901dSGao Xiang
712109901dSGao Xiang - Support tailpacking inline compared to byte-addressed unaligned metadata
722109901dSGao Xiang   or smaller block size alternatives;
732109901dSGao Xiang
742109901dSGao Xiang - Support merging tail-end data into a special inode as fragments.
752109901dSGao Xiang
76e6687b89SJingbo Xu - Support large folios for uncompressed files.
77e6687b89SJingbo Xu
786e95d0a0SGao Xiang - Support direct I/O on uncompressed files to avoid double caching for loop
796e95d0a0SGao Xiang   devices;
806e95d0a0SGao Xiang
816e95d0a0SGao Xiang - Support FSDAX on uncompressed images for secure containers and ramdisks in
826e95d0a0SGao Xiang   order to get rid of unnecessary page cache.
836e95d0a0SGao Xiang
846e95d0a0SGao Xiang - Support file-based on-demand loading with the Fscache infrastructure.
85e66d8631SMauro Carvalho Chehab
86e66d8631SMauro Carvalho ChehabThe following git tree provides the file system user-space tools under
876e95d0a0SGao Xiangdevelopment, such as a formatting tool (mkfs.erofs), an on-disk consistency &
886e95d0a0SGao Xiangcompatibility checking tool (fsck.erofs), and a debugging tool (dump.erofs):
89e66d8631SMauro Carvalho Chehab
90e66d8631SMauro Carvalho Chehab- git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
91e66d8631SMauro Carvalho Chehab
92e66d8631SMauro Carvalho ChehabBugs and patches are welcome, please kindly help us and send to the following
93e66d8631SMauro Carvalho Chehablinux-erofs mailing list:
94e66d8631SMauro Carvalho Chehab
95e66d8631SMauro Carvalho Chehab- linux-erofs mailing list   <linux-erofs@lists.ozlabs.org>
96e66d8631SMauro Carvalho Chehab
97e66d8631SMauro Carvalho ChehabMount options
98e66d8631SMauro Carvalho Chehab=============
99e66d8631SMauro Carvalho Chehab
100e66d8631SMauro Carvalho Chehab===================    =========================================================
101e66d8631SMauro Carvalho Chehab(no)user_xattr         Setup Extended User Attributes. Note: xattr is enabled
102e66d8631SMauro Carvalho Chehab                       by default if CONFIG_EROFS_FS_XATTR is selected.
103e66d8631SMauro Carvalho Chehab(no)acl                Setup POSIX Access Control List. Note: acl is enabled
104e66d8631SMauro Carvalho Chehab                       by default if CONFIG_EROFS_FS_POSIX_ACL is selected.
105e66d8631SMauro Carvalho Chehabcache_strategy=%s      Select a strategy for cached decompression from now on:
106e66d8631SMauro Carvalho Chehab
107e66d8631SMauro Carvalho Chehab		       ==========  =============================================
108e66d8631SMauro Carvalho Chehab                         disabled  In-place I/O decompression only;
109e66d8631SMauro Carvalho Chehab                        readahead  Cache the last incomplete compressed physical
110e66d8631SMauro Carvalho Chehab                                   cluster for further reading. It still does
111e66d8631SMauro Carvalho Chehab                                   in-place I/O decompression for the rest
112e66d8631SMauro Carvalho Chehab                                   compressed physical clusters;
113e66d8631SMauro Carvalho Chehab                       readaround  Cache the both ends of incomplete compressed
114e66d8631SMauro Carvalho Chehab                                   physical clusters for further reading.
115e66d8631SMauro Carvalho Chehab                                   It still does in-place I/O decompression
116e66d8631SMauro Carvalho Chehab                                   for the rest compressed physical clusters.
117e66d8631SMauro Carvalho Chehab		       ==========  =============================================
11806252e9cSGao Xiangdax={always,never}     Use direct access (no page cache).  See
11906252e9cSGao Xiang                       Documentation/filesystems/dax.rst.
12006252e9cSGao Xiangdax                    A legacy option which is an alias for ``dax=always``.
121dfeab2e9SGao Xiangdevice=%s              Specify a path to an extra device to be used together.
1226e95d0a0SGao Xiangfsid=%s                Specify a filesystem image ID for Fscache back-end.
123*b22c7b97SJingbo Xudomain_id=%s           Specify a domain ID in fscache mode so that different images
124*b22c7b97SJingbo Xu                       with the same blobs under a given domain ID can share storage.
125e66d8631SMauro Carvalho Chehab===================    =========================================================
126e66d8631SMauro Carvalho Chehab
127168e9a76SHuang JiananSysfs Entries
128168e9a76SHuang Jianan=============
129168e9a76SHuang Jianan
130168e9a76SHuang JiananInformation about mounted erofs file systems can be found in /sys/fs/erofs.
131168e9a76SHuang JiananEach mounted filesystem will have a directory in /sys/fs/erofs based on its
132168e9a76SHuang Jianandevice name (i.e., /sys/fs/erofs/sda).
133168e9a76SHuang Jianan(see also Documentation/ABI/testing/sysfs-fs-erofs)
134168e9a76SHuang Jianan
135e66d8631SMauro Carvalho ChehabOn-disk details
136e66d8631SMauro Carvalho Chehab===============
137e66d8631SMauro Carvalho Chehab
138e66d8631SMauro Carvalho ChehabSummary
139e66d8631SMauro Carvalho Chehab-------
140e66d8631SMauro Carvalho ChehabDifferent from other read-only file systems, an EROFS volume is designed
141e66d8631SMauro Carvalho Chehabto be as simple as possible::
142e66d8631SMauro Carvalho Chehab
143e66d8631SMauro Carvalho Chehab                                |-> aligned with the block size
144e66d8631SMauro Carvalho Chehab   ____________________________________________________________
145e66d8631SMauro Carvalho Chehab  | |SB| | ... | Metadata | ... | Data | Metadata | ... | Data |
146e66d8631SMauro Carvalho Chehab  |_|__|_|_____|__________|_____|______|__________|_____|______|
147e66d8631SMauro Carvalho Chehab  0 +1K
148e66d8631SMauro Carvalho Chehab
149e66d8631SMauro Carvalho ChehabAll data areas should be aligned with the block size, but metadata areas
150e66d8631SMauro Carvalho Chehabmay not. All metadatas can be now observed in two different spaces (views):
151e66d8631SMauro Carvalho Chehab
152e66d8631SMauro Carvalho Chehab 1. Inode metadata space
153e66d8631SMauro Carvalho Chehab
154e66d8631SMauro Carvalho Chehab    Each valid inode should be aligned with an inode slot, which is a fixed
155e66d8631SMauro Carvalho Chehab    value (32 bytes) and designed to be kept in line with compact inode size.
156e66d8631SMauro Carvalho Chehab
157e66d8631SMauro Carvalho Chehab    Each inode can be directly found with the following formula:
158e66d8631SMauro Carvalho Chehab         inode offset = meta_blkaddr * block_size + 32 * nid
159e66d8631SMauro Carvalho Chehab
160e66d8631SMauro Carvalho Chehab    ::
161e66d8631SMauro Carvalho Chehab
162e66d8631SMauro Carvalho Chehab                                 |-> aligned with 8B
163e66d8631SMauro Carvalho Chehab                                            |-> followed closely
164e66d8631SMauro Carvalho Chehab     + meta_blkaddr blocks                                      |-> another slot
165e66d8631SMauro Carvalho Chehab       _____________________________________________________________________
166e66d8631SMauro Carvalho Chehab     |  ...   | inode |  xattrs  | extents  | data inline | ... | inode ...
167e66d8631SMauro Carvalho Chehab     |________|_______|(optional)|(optional)|__(optional)_|_____|__________
168e66d8631SMauro Carvalho Chehab              |-> aligned with the inode slot size
169e66d8631SMauro Carvalho Chehab                   .                   .
170e66d8631SMauro Carvalho Chehab                 .                         .
171e66d8631SMauro Carvalho Chehab               .                              .
172e66d8631SMauro Carvalho Chehab             .                                    .
173e66d8631SMauro Carvalho Chehab           .                                         .
174e66d8631SMauro Carvalho Chehab         .                                              .
175e66d8631SMauro Carvalho Chehab       .____________________________________________________|-> aligned with 4B
176e66d8631SMauro Carvalho Chehab       | xattr_ibody_header | shared xattrs | inline xattrs |
177e66d8631SMauro Carvalho Chehab       |____________________|_______________|_______________|
178e66d8631SMauro Carvalho Chehab       |->    12 bytes    <-|->x * 4 bytes<-|               .
179e66d8631SMauro Carvalho Chehab                           .                .                 .
180e66d8631SMauro Carvalho Chehab                     .                      .                   .
181e66d8631SMauro Carvalho Chehab                .                           .                     .
182e66d8631SMauro Carvalho Chehab            ._______________________________.______________________.
183e66d8631SMauro Carvalho Chehab            | id | id | id | id |  ... | id | ent | ... | ent| ... |
184e66d8631SMauro Carvalho Chehab            |____|____|____|____|______|____|_____|_____|____|_____|
185e66d8631SMauro Carvalho Chehab                                            |-> aligned with 4B
186e66d8631SMauro Carvalho Chehab                                                        |-> aligned with 4B
187e66d8631SMauro Carvalho Chehab
188e66d8631SMauro Carvalho Chehab    Inode could be 32 or 64 bytes, which can be distinguished from a common
189e66d8631SMauro Carvalho Chehab    field which all inode versions have -- i_format::
190e66d8631SMauro Carvalho Chehab
191e66d8631SMauro Carvalho Chehab        __________________               __________________
192e66d8631SMauro Carvalho Chehab       |     i_format     |             |     i_format     |
193e66d8631SMauro Carvalho Chehab       |__________________|             |__________________|
194e66d8631SMauro Carvalho Chehab       |        ...       |             |        ...       |
195e66d8631SMauro Carvalho Chehab       |                  |             |                  |
196e66d8631SMauro Carvalho Chehab       |__________________| 32 bytes    |                  |
197e66d8631SMauro Carvalho Chehab                                        |                  |
198e66d8631SMauro Carvalho Chehab                                        |__________________| 64 bytes
199e66d8631SMauro Carvalho Chehab
200e66d8631SMauro Carvalho Chehab    Xattrs, extents, data inline are followed by the corresponding inode with
201e66d8631SMauro Carvalho Chehab    proper alignment, and they could be optional for different data mappings.
2022a9dc7a8SGao Xiang    _currently_ total 5 data layouts are supported:
203e66d8631SMauro Carvalho Chehab
204e66d8631SMauro Carvalho Chehab    ==  ====================================================================
205e66d8631SMauro Carvalho Chehab     0  flat file data without data inline (no extent);
206e66d8631SMauro Carvalho Chehab     1  fixed-sized output data compression (with non-compacted indexes);
207e66d8631SMauro Carvalho Chehab     2  flat file data with tail packing data inline (no extent);
2082a9dc7a8SGao Xiang     3  fixed-sized output data compression (with compacted indexes, v5.3+);
2092a9dc7a8SGao Xiang     4  chunk-based file (v5.15+).
210e66d8631SMauro Carvalho Chehab    ==  ====================================================================
211e66d8631SMauro Carvalho Chehab
212e66d8631SMauro Carvalho Chehab    The size of the optional xattrs is indicated by i_xattr_count in inode
213e66d8631SMauro Carvalho Chehab    header. Large xattrs or xattrs shared by many different files can be
214e66d8631SMauro Carvalho Chehab    stored in shared xattrs metadata rather than inlined right after inode.
215e66d8631SMauro Carvalho Chehab
216e66d8631SMauro Carvalho Chehab 2. Shared xattrs metadata space
217e66d8631SMauro Carvalho Chehab
218e66d8631SMauro Carvalho Chehab    Shared xattrs space is similar to the above inode space, started with
219e66d8631SMauro Carvalho Chehab    a specific block indicated by xattr_blkaddr, organized one by one with
220e66d8631SMauro Carvalho Chehab    proper align.
221e66d8631SMauro Carvalho Chehab
222e66d8631SMauro Carvalho Chehab    Each share xattr can also be directly found by the following formula:
223e66d8631SMauro Carvalho Chehab         xattr offset = xattr_blkaddr * block_size + 4 * xattr_id
224e66d8631SMauro Carvalho Chehab
225e66d8631SMauro Carvalho Chehab::
226e66d8631SMauro Carvalho Chehab
227e66d8631SMauro Carvalho Chehab                           |-> aligned by  4 bytes
228e66d8631SMauro Carvalho Chehab    + xattr_blkaddr blocks                     |-> aligned with 4 bytes
229e66d8631SMauro Carvalho Chehab     _________________________________________________________________________
230e66d8631SMauro Carvalho Chehab    |  ...   | xattr_entry |  xattr data | ... |  xattr_entry | xattr data  ...
231e66d8631SMauro Carvalho Chehab    |________|_____________|_____________|_____|______________|_______________
232e66d8631SMauro Carvalho Chehab
233e66d8631SMauro Carvalho ChehabDirectories
234e66d8631SMauro Carvalho Chehab-----------
235e66d8631SMauro Carvalho ChehabAll directories are now organized in a compact on-disk format. Note that
236e66d8631SMauro Carvalho Chehabeach directory block is divided into index and name areas in order to support
237e66d8631SMauro Carvalho Chehabrandom file lookup, and all directory entries are _strictly_ recorded in
238e66d8631SMauro Carvalho Chehabalphabetical order in order to support improved prefix binary search
239e66d8631SMauro Carvalho Chehabalgorithm (could refer to the related source code).
240e66d8631SMauro Carvalho Chehab
241e66d8631SMauro Carvalho Chehab::
242e66d8631SMauro Carvalho Chehab
243e66d8631SMauro Carvalho Chehab                  ___________________________
244e66d8631SMauro Carvalho Chehab                 /                           |
245e66d8631SMauro Carvalho Chehab                /              ______________|________________
246e66d8631SMauro Carvalho Chehab               /              /              | nameoff1       | nameoffN-1
247e66d8631SMauro Carvalho Chehab  ____________.______________._______________v________________v__________
248e66d8631SMauro Carvalho Chehab | dirent | dirent | ... | dirent | filename | filename | ... | filename |
249e66d8631SMauro Carvalho Chehab |___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____|
250e66d8631SMauro Carvalho Chehab      \                           ^
251e66d8631SMauro Carvalho Chehab       \                          |                           * could have
252e66d8631SMauro Carvalho Chehab        \                         |                             trailing '\0'
253e66d8631SMauro Carvalho Chehab         \________________________| nameoff0
254e66d8631SMauro Carvalho Chehab                             Directory block
255e66d8631SMauro Carvalho Chehab
256e66d8631SMauro Carvalho ChehabNote that apart from the offset of the first filename, nameoff0 also indicates
257e66d8631SMauro Carvalho Chehabthe total number of directory entries in this block since it is no need to
258e66d8631SMauro Carvalho Chehabintroduce another on-disk field at all.
259e66d8631SMauro Carvalho Chehab
2606e95d0a0SGao XiangChunk-based files
2616e95d0a0SGao Xiang-----------------
2622a9dc7a8SGao XiangIn order to support chunk-based data deduplication, a new inode data layout has
2632a9dc7a8SGao Xiangbeen supported since Linux v5.15: Files are split in equal-sized data chunks
2642a9dc7a8SGao Xiangwith ``extents`` area of the inode metadata indicating how to get the chunk
2652a9dc7a8SGao Xiangdata: these can be simply as a 4-byte block address array or in the 8-byte
2662a9dc7a8SGao Xiangchunk index form (see struct erofs_inode_chunk_index in erofs_fs.h for more
2672a9dc7a8SGao Xiangdetails.)
2682a9dc7a8SGao Xiang
2692a9dc7a8SGao XiangBy the way, chunk-based files are all uncompressed for now.
2702a9dc7a8SGao Xiang
27146f2e044SGao XiangData compression
27246f2e044SGao Xiang----------------
2732109901dSGao XiangEROFS implements fixed-sized output compression which generates fixed-sized
27446f2e044SGao Xiangcompressed data blocks from variable-sized input in contrast to other existing
27546f2e044SGao Xiangfixed-sized input solutions. Relatively higher compression ratios can be gotten
27646f2e044SGao Xiangby using fixed-sized output compression since nowadays popular data compression
27746f2e044SGao Xiangalgorithms are mostly LZ77-based and such fixed-sized output approach can be
27846f2e044SGao Xiangbenefited from the historical dictionary (aka. sliding window).
27946f2e044SGao Xiang
28046f2e044SGao XiangIn details, original (uncompressed) data is turned into several variable-sized
28146f2e044SGao Xiangextents and in the meanwhile, compressed into physical clusters (pclusters).
28246f2e044SGao XiangIn order to record each variable-sized extent, logical clusters (lclusters) are
28346f2e044SGao Xiangintroduced as the basic unit of compress indexes to indicate whether a new
28446f2e044SGao Xiangextent is generated within the range (HEAD) or not (NONHEAD). Lclusters are now
28546f2e044SGao Xiangfixed in block size, as illustrated below::
286e66d8631SMauro Carvalho Chehab
2871b55767dSGao Xiang          |<-    variable-sized extent    ->|<-       VLE         ->|
288e66d8631SMauro Carvalho Chehab        clusterofs                        clusterofs              clusterofs
2891b55767dSGao Xiang          |                                 |                       |
2901b55767dSGao Xiang _________v_________________________________v_______________________v________
2911b55767dSGao Xiang ... |    .         |              |        .     |              |  .   ...
2921b55767dSGao Xiang ____|____._________|______________|________.___ _|______________|__.________
2931b55767dSGao Xiang     |-> lcluster <-|-> lcluster <-|-> lcluster <-|-> lcluster <-|
29446f2e044SGao Xiang          (HEAD)        (NONHEAD)       (HEAD)        (NONHEAD)    .
29546f2e044SGao Xiang           .             CBLKCNT            .                    .
29646f2e044SGao Xiang            .                               .                  .
29746f2e044SGao Xiang             .                              .                .
29846f2e044SGao Xiang       _______._____________________________.______________._________________
2991b55767dSGao Xiang          ... |              |              |              | ...
3001b55767dSGao Xiang       _______|______________|______________|______________|_________________
30146f2e044SGao Xiang              |->      big pcluster       <-|-> pcluster <-|
302e66d8631SMauro Carvalho Chehab
30346f2e044SGao XiangA physical cluster can be seen as a container of physical compressed blocks
30446f2e044SGao Xiangwhich contains compressed data. Previously, only lcluster-sized (4KB) pclusters
30546f2e044SGao Xiangwere supported. After big pcluster feature is introduced (available since
30646f2e044SGao XiangLinux v5.13), pcluster can be a multiple of lcluster size.
307e66d8631SMauro Carvalho Chehab
30846f2e044SGao XiangFor each HEAD lcluster, clusterofs is recorded to indicate where a new extent
30946f2e044SGao Xiangstarts and blkaddr is used to seek the compressed data. For each NONHEAD
31046f2e044SGao Xianglcluster, delta0 and delta1 are available instead of blkaddr to indicate the
31146f2e044SGao Xiangdistance to its HEAD lcluster and the next HEAD lcluster. A PLAIN lcluster is
31246f2e044SGao Xiangalso a HEAD lcluster except that its data is uncompressed. See the comments
31346f2e044SGao Xiangaround "struct z_erofs_vle_decompressed_index" in erofs_fs.h for more details.
31446f2e044SGao Xiang
31546f2e044SGao XiangIf big pcluster is enabled, pcluster size in lclusters needs to be recorded as
31646f2e044SGao Xiangwell. Let the delta0 of the first NONHEAD lcluster store the compressed block
31746f2e044SGao Xiangcount with a special flag as a new called CBLKCNT NONHEAD lcluster. It's easy
31846f2e044SGao Xiangto understand its delta0 is constantly 1, as illustrated below::
31946f2e044SGao Xiang
32046f2e044SGao Xiang   __________________________________________________________
32146f2e044SGao Xiang  | HEAD |  NONHEAD  | NONHEAD | ... | NONHEAD | HEAD | HEAD |
32246f2e044SGao Xiang  |__:___|_(CBLKCNT)_|_________|_____|_________|__:___|____:_|
32346f2e044SGao Xiang     |<----- a big pcluster (with CBLKCNT) ------>|<--  -->|
32446f2e044SGao Xiang           a lcluster-sized pcluster (without CBLKCNT) ^
32546f2e044SGao Xiang
32646f2e044SGao XiangIf another HEAD follows a HEAD lcluster, there is no room to record CBLKCNT,
32746f2e044SGao Xiangbut it's easy to know the size of such pcluster is 1 lcluster as well.
3282109901dSGao Xiang
3292109901dSGao XiangSince Linux v6.1, each pcluster can be used for multiple variable-sized extents,
3302109901dSGao Xiangtherefore it can be used for compressed data deduplication.
331