Commit e66d8631 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet

docs: filesystems: convert erofs.txt to ReST

- Add a SPDX header;
- Add a document title;
- Some whitespace fixes and new line breaks;
- Mark literal blocks as such;
- Add table markups;
- Add lists markups;
- Add it to filesystems/index.rst.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/402d1d2f7252b8a683f7a9c6867bc5428da64026.1581955849.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 06dedb45
.. SPDX-License-Identifier: GPL-2.0
======================================
Enhanced Read-Only File System - EROFS
======================================
Overview Overview
======== ========
...@@ -6,6 +12,7 @@ from other read-only file systems, it aims to be designed for flexibility, ...@@ -6,6 +12,7 @@ from other read-only file systems, it aims to be designed for flexibility,
scalability, but be kept simple and high performance. scalability, but be kept simple and high performance.
It is designed as a better filesystem solution for the following scenarios: It is designed as a better filesystem solution for the following scenarios:
- read-only storage media or - read-only storage media or
- part of a fully trusted read-only solution, which means it needs to be - part of a fully trusted read-only solution, which means it needs to be
...@@ -17,6 +24,7 @@ It is designed as a better filesystem solution for the following scenarios: ...@@ -17,6 +24,7 @@ It is designed as a better filesystem solution for the following scenarios:
for those embedded devices with limited memory (ex, smartphone); for those embedded devices with limited memory (ex, smartphone);
Here is the main features of EROFS: Here is the main features of EROFS:
- Little endian on-disk design; - Little endian on-disk design;
- Currently 4KB block size (nobh) and therefore maximum 16TB address space; - Currently 4KB block size (nobh) and therefore maximum 16TB address space;
...@@ -24,13 +32,17 @@ Here is the main features of EROFS: ...@@ -24,13 +32,17 @@ Here is the main features of EROFS:
- Metadata & data could be mixed by design; - Metadata & data could be mixed by design;
- 2 inode versions for different requirements: - 2 inode versions for different requirements:
===================== ============ =====================================
compact (v1) extended (v2) compact (v1) extended (v2)
Inode metadata size: 32 bytes 64 bytes ===================== ============ =====================================
Max file size: 4 GB 16 EB (also limited by max. vol size) Inode metadata size 32 bytes 64 bytes
Max uids/gids: 65536 4294967296 Max file size 4 GB 16 EB (also limited by max. vol size)
File change time: no yes (64 + 32-bit timestamp) Max uids/gids 65536 4294967296
Max hardlinks: 65536 4294967296 File change time no yes (64 + 32-bit timestamp)
Metadata reserved: 4 bytes 14 bytes Max hardlinks 65536 4294967296
Metadata reserved 4 bytes 14 bytes
===================== ============ =====================================
- Support extended attributes (xattrs) as an option; - Support extended attributes (xattrs) as an option;
...@@ -43,29 +55,36 @@ Here is the main features of EROFS: ...@@ -43,29 +55,36 @@ Here is the main features of EROFS:
The following git tree provides the file system user-space tools under The following git tree provides the file system user-space tools under
development (ex, formatting tool mkfs.erofs): development (ex, formatting tool mkfs.erofs):
>> git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
- git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git
Bugs and patches are welcome, please kindly help us and send to the following Bugs and patches are welcome, please kindly help us and send to the following
linux-erofs mailing list: linux-erofs mailing list:
>> linux-erofs mailing list <linux-erofs@lists.ozlabs.org>
- linux-erofs mailing list <linux-erofs@lists.ozlabs.org>
Mount options Mount options
============= =============
=================== =========================================================
(no)user_xattr Setup Extended User Attributes. Note: xattr is enabled (no)user_xattr Setup Extended User Attributes. Note: xattr is enabled
by default if CONFIG_EROFS_FS_XATTR is selected. by default if CONFIG_EROFS_FS_XATTR is selected.
(no)acl Setup POSIX Access Control List. Note: acl is enabled (no)acl Setup POSIX Access Control List. Note: acl is enabled
by default if CONFIG_EROFS_FS_POSIX_ACL is selected. by default if CONFIG_EROFS_FS_POSIX_ACL is selected.
cache_strategy=%s Select a strategy for cached decompression from now on: cache_strategy=%s Select a strategy for cached decompression from now on:
disabled: In-place I/O decompression only;
readahead: Cache the last incomplete compressed physical ========== =============================================
disabled In-place I/O decompression only;
readahead Cache the last incomplete compressed physical
cluster for further reading. It still does cluster for further reading. It still does
in-place I/O decompression for the rest in-place I/O decompression for the rest
compressed physical clusters; compressed physical clusters;
readaround: Cache the both ends of incomplete compressed readaround Cache the both ends of incomplete compressed
physical clusters for further reading. physical clusters for further reading.
It still does in-place I/O decompression It still does in-place I/O decompression
for the rest compressed physical clusters. for the rest compressed physical clusters.
========== =============================================
=================== =========================================================
On-disk details On-disk details
=============== ===============
...@@ -73,7 +92,7 @@ On-disk details ...@@ -73,7 +92,7 @@ On-disk details
Summary Summary
------- -------
Different from other read-only file systems, an EROFS volume is designed Different from other read-only file systems, an EROFS volume is designed
to be as simple as possible: to be as simple as possible::
|-> aligned with the block size |-> aligned with the block size
____________________________________________________________ ____________________________________________________________
...@@ -83,13 +102,17 @@ to be as simple as possible: ...@@ -83,13 +102,17 @@ to be as simple as possible:
All data areas should be aligned with the block size, but metadata areas All 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): may not. All metadatas can be now observed in two different spaces (views):
1. Inode metadata space 1. Inode metadata space
Each valid inode should be aligned with an inode slot, which is a fixed 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. value (32 bytes) and designed to be kept in line with compact inode size.
Each inode can be directly found with the following formula: Each inode can be directly found with the following formula:
inode offset = meta_blkaddr * block_size + 32 * nid inode offset = meta_blkaddr * block_size + 32 * nid
::
|-> aligned with 8B |-> aligned with 8B
|-> followed closely |-> followed closely
+ meta_blkaddr blocks |-> another slot + meta_blkaddr blocks |-> another slot
...@@ -117,7 +140,7 @@ may not. All metadatas can be now observed in two different spaces (views): ...@@ -117,7 +140,7 @@ may not. All metadatas can be now observed in two different spaces (views):
|-> aligned with 4B |-> aligned with 4B
Inode could be 32 or 64 bytes, which can be distinguished from a common Inode could be 32 or 64 bytes, which can be distinguished from a common
field which all inode versions have -- i_format: field which all inode versions have -- i_format::
__________________ __________________ __________________ __________________
| i_format | | i_format | | i_format | | i_format |
...@@ -132,16 +155,19 @@ may not. All metadatas can be now observed in two different spaces (views): ...@@ -132,16 +155,19 @@ may not. All metadatas can be now observed in two different spaces (views):
proper alignment, and they could be optional for different data mappings. proper alignment, and they could be optional for different data mappings.
_currently_ total 4 valid data mappings are supported: _currently_ total 4 valid data mappings are supported:
== ====================================================================
0 flat file data without data inline (no extent); 0 flat file data without data inline (no extent);
1 fixed-sized output data compression (with non-compacted indexes); 1 fixed-sized output data compression (with non-compacted indexes);
2 flat file data with tail packing data inline (no extent); 2 flat file data with tail packing data inline (no extent);
3 fixed-sized output data compression (with compacted indexes, v5.3+). 3 fixed-sized output data compression (with compacted indexes, v5.3+).
== ====================================================================
The size of the optional xattrs is indicated by i_xattr_count in inode 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 header. Large xattrs or xattrs shared by many different files can be
stored in shared xattrs metadata rather than inlined right after inode. stored in shared xattrs metadata rather than inlined right after inode.
2. Shared xattrs metadata space 2. Shared xattrs metadata space
Shared xattrs space is similar to the above inode space, started with Shared xattrs space is similar to the above inode space, started with
a specific block indicated by xattr_blkaddr, organized one by one with a specific block indicated by xattr_blkaddr, organized one by one with
proper align. proper align.
...@@ -149,6 +175,8 @@ may not. All metadatas can be now observed in two different spaces (views): ...@@ -149,6 +175,8 @@ may not. All metadatas can be now observed in two different spaces (views):
Each share xattr can also be directly found by the following formula: Each share xattr can also be directly found by the following formula:
xattr offset = xattr_blkaddr * block_size + 4 * xattr_id xattr offset = xattr_blkaddr * block_size + 4 * xattr_id
::
|-> aligned by 4 bytes |-> aligned by 4 bytes
+ xattr_blkaddr blocks |-> aligned with 4 bytes + xattr_blkaddr blocks |-> aligned with 4 bytes
_________________________________________________________________________ _________________________________________________________________________
...@@ -163,13 +191,15 @@ random file lookup, and all directory entries are _strictly_ recorded in ...@@ -163,13 +191,15 @@ random file lookup, and all directory entries are _strictly_ recorded in
alphabetical order in order to support improved prefix binary search alphabetical order in order to support improved prefix binary search
algorithm (could refer to the related source code). algorithm (could refer to the related source code).
::
___________________________ ___________________________
/ | / |
/ ______________|________________ / ______________|________________
/ / | nameoff1 | nameoffN-1 / / | nameoff1 | nameoffN-1
____________.______________._______________v________________v__________ ____________.______________._______________v________________v__________
| dirent | dirent | ... | dirent | filename | filename | ... | filename | | dirent | dirent | ... | dirent | filename | filename | ... | filename |
|___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____| |___.0___|____1___|_____|___N-1__|____0_____|____1_____|_____|___N-1____|
\ ^ \ ^
\ | * could have \ | * could have
\ | trailing '\0' \ | trailing '\0'
...@@ -184,14 +214,14 @@ introduce another on-disk field at all. ...@@ -184,14 +214,14 @@ introduce another on-disk field at all.
Compression Compression
----------- -----------
Currently, EROFS supports 4KB fixed-sized output transparent file compression, Currently, EROFS supports 4KB fixed-sized output transparent file compression,
as illustrated below: as illustrated below::
|---- Variant-Length Extent ----|-------- VLE --------|----- VLE ----- |---- Variant-Length Extent ----|-------- VLE --------|----- VLE -----
clusterofs clusterofs clusterofs clusterofs clusterofs clusterofs
| | | logical data | | | logical data
_________v_______________________________v_____________________v_______________ _________v_______________________________v_____________________v_______________
... | . | | . | | . | ... ... | . | | . | | . | ...
____|____.________|_____________|________.____|_____________|__.__________|____ ____|____.________|_____________|________.____|_____________|__.__________|____
|-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-| |-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-|-> cluster <-|
size size size size size size size size size size
. . . . . . . .
...@@ -208,4 +238,3 @@ at most. For each logical cluster, there is a corresponding on-disk index to ...@@ -208,4 +238,3 @@ at most. For each logical cluster, there is a corresponding on-disk index to
describe its cluster type, physical cluster address, etc. describe its cluster type, physical cluster address, etc.
See "struct z_erofs_vle_decompressed_index" in erofs_fs.h for more details. See "struct z_erofs_vle_decompressed_index" in erofs_fs.h for more details.
...@@ -61,6 +61,7 @@ Documentation for filesystem implementations. ...@@ -61,6 +61,7 @@ Documentation for filesystem implementations.
dlmfs dlmfs
ecryptfs ecryptfs
efivarfs efivarfs
erofs
fuse fuse
overlayfs overlayfs
virtiofs virtiofs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment