xref: /linux/fs/erofs/Kconfig (revision 73ae59e975966d24e32926247ddb45a537ebe184)
1# SPDX-License-Identifier: GPL-2.0-only
2
3config EROFS_FS
4	tristate "EROFS filesystem support"
5	depends on BLOCK
6	select CRC32
7	select CRYPTO if EROFS_FS_ZIP_ACCEL
8	select CRYPTO_DEFLATE if EROFS_FS_ZIP_ACCEL
9	select FS_IOMAP
10	select LZ4_DECOMPRESS if EROFS_FS_ZIP
11	select XXHASH if EROFS_FS_XATTR
12	select XZ_DEC if EROFS_FS_ZIP_LZMA
13	select XZ_DEC_MICROLZMA if EROFS_FS_ZIP_LZMA
14	select ZLIB_INFLATE if EROFS_FS_ZIP_DEFLATE
15	select ZSTD_DECOMPRESS if EROFS_FS_ZIP_ZSTD
16	help
17	  EROFS (Enhanced Read-Only File System) is a modern, lightweight,
18	  secure read-only filesystem for various use cases, such as immutable
19	  system images, container images, application sandboxes, and datasets.
20
21	  EROFS uses a flexible, hierarchical on-disk design so that features
22	  can be enabled on demand: the core on-disk format is block-aligned in
23	  order to perform optimally on all kinds of devices, including block
24	  and memory-backed devices; the format is easy to parse and has zero
25	  metadata redundancy, unlike generic filesystems, making it ideal for
26	  filesystem auditing and remote access; inline data, random-access
27	  friendly directory data, inline/shared extended attributes and
28	  chunk-based deduplication ensure space efficiency while maintaining
29	  high performance.
30
31	  Optionally, it supports multiple devices to reference external data,
32	  enabling data sharing for container images.
33
34	  It also has advanced encoded on-disk layouts, particularly for data
35	  compression and fine-grained deduplication. It utilizes fixed-size
36	  output compression to improve storage density while keeping relatively
37	  high compression ratios. Furthermore, it implements in-place
38	  decompression to reuse file pages to keep compressed data temporarily
39	  with proper strategies, which ensures guaranteed end-to-end runtime
40	  performance under extreme memory pressure without extra cost.
41
42	  For more details, see the web pages at <https://erofs.docs.kernel.org>
43	  and the documentation at <file:Documentation/filesystems/erofs.rst>.
44
45	  To compile EROFS filesystem support as a module, choose M here. The
46	  module will be called erofs.
47
48	  If unsure, say N.
49
50config EROFS_FS_DEBUG
51	bool "EROFS debugging feature"
52	depends on EROFS_FS
53	help
54	  Print debugging messages and enable more BUG_ONs which check
55	  filesystem consistency and find potential issues aggressively,
56	  which can be used for Android eng build, for example.
57
58	  For daily use, say N.
59
60config EROFS_FS_XATTR
61	bool "EROFS extended attributes"
62	depends on EROFS_FS
63	default y
64	help
65	  Extended attributes are name:value pairs associated with inodes by
66	  the kernel or by users (see the attr(5) manual page, or visit
67	  <http://acl.bestbits.at/> for details).
68
69	  If unsure, say N.
70
71config EROFS_FS_POSIX_ACL
72	bool "EROFS Access Control Lists"
73	depends on EROFS_FS_XATTR
74	select FS_POSIX_ACL
75	default y
76	help
77	  Posix Access Control Lists (ACLs) support permissions for users and
78	  groups beyond the owner/group/world scheme.
79
80	  To learn more about Access Control Lists, visit the POSIX ACLs for
81	  Linux website <http://acl.bestbits.at/>.
82
83	  If you don't know what Access Control Lists are, say N.
84
85config EROFS_FS_SECURITY
86	bool "EROFS Security Labels"
87	depends on EROFS_FS_XATTR
88	default y
89	help
90	  Security labels provide an access control facility to support Linux
91	  Security Models (LSMs) accepted by AppArmor, SELinux, Smack and TOMOYO
92	  Linux. This option enables an extended attribute handler for file
93	  security labels in the erofs filesystem, so that it requires enabling
94	  the extended attribute support in advance.
95
96	  If you are not using a security module, say N.
97
98config EROFS_FS_BACKED_BY_FILE
99	bool "File-backed EROFS filesystem support"
100	depends on EROFS_FS
101	default y
102	help
103	  This allows EROFS to use filesystem image files directly, without
104	  the intercession of loopback block devices or likewise. It is
105	  particularly useful for container images with numerous blobs and
106	  other sandboxes, where loop devices behave intricately.  It can also
107	  be used to simplify error-prone lifetime management of unnecessary
108	  virtual block devices.
109
110	  If you don't want to enable this feature, say N.
111
112config EROFS_FS_ZIP
113	bool "EROFS Data Compression Support"
114	depends on EROFS_FS
115	default y
116	help
117	  Enable EROFS compression layouts so that filesystems containing
118	  compressed files can be parsed by the kernel.
119
120	  If you don't want to enable compression feature, say N.
121
122config EROFS_FS_ZIP_LZMA
123	bool "EROFS LZMA compressed data support"
124	depends on EROFS_FS_ZIP
125	default y
126	help
127	  Saying Y here includes support for reading EROFS file systems
128	  containing LZMA compressed data, specifically called microLZMA. It
129	  gives better compression ratios than the default LZ4 format, at the
130	  expense of more CPU overhead.
131
132	  Say N if you want to disable LZMA compression support.
133
134config EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS
135	int "EROFS LZMA default maximum decompression streams" if SMP
136	depends on EROFS_FS_ZIP_LZMA
137	range 1 NR_CPUS if SMP
138	range 1 1 if !SMP
139	default 16 if SMP && NR_CPUS >= 16
140	default NR_CPUS if SMP
141	default 1
142	help
143	  By default EROFS allocates one LZMA decompression stream per CPU.
144	  Each stream can hold a dictionary of up to 8 MiB taken from the
145	  mounted image, so on systems with many CPUs this can reserve a lot
146	  of memory.  This caps the default; the lzma_streams module parameter
147	  still overrides it.
148
149	  If unsure, keep the suggested default (16 or lower).
150
151config EROFS_FS_ZIP_DEFLATE
152	bool "EROFS DEFLATE compressed data support"
153	depends on EROFS_FS_ZIP
154	help
155	  Saying Y here includes support for reading EROFS file systems
156	  containing DEFLATE compressed data.  It gives better compression
157	  ratios than the default LZ4 format, while it costs more CPU
158	  overhead.
159
160	  If unsure, say N.
161
162config EROFS_FS_ZIP_ZSTD
163	bool "EROFS Zstandard compressed data support"
164	depends on EROFS_FS_ZIP
165	help
166	  Saying Y here includes support for reading EROFS file systems
167	  containing Zstandard compressed data.  It gives better compression
168	  ratios than the default LZ4 format, while it costs more CPU
169	  overhead and memory footprint.
170
171	  If unsure, say N.
172
173config EROFS_FS_ZIP_ACCEL
174	bool "EROFS hardware decompression support"
175	depends on EROFS_FS_ZIP
176	help
177	  Saying Y here includes hardware accelerator support for reading
178	  EROFS file systems containing compressed data.  It gives better
179	  decompression speed than the software-implemented decompression, and
180	  it costs lower CPU overhead.
181
182	  Hardware accelerator support is an experimental feature for now and
183	  file systems are still readable without selecting this option.
184
185	  If unsure, say N.
186
187config EROFS_FS_PCPU_KTHREAD
188	bool "EROFS per-cpu decompression kthread workers"
189	depends on EROFS_FS_ZIP
190	help
191	  Saying Y here enables per-CPU kthread workers pool to carry out
192	  async decompression for low latencies on some architectures.
193
194	  If unsure, say N.
195
196config EROFS_FS_PCPU_KTHREAD_HIPRI
197	bool "EROFS high priority per-CPU kthread workers"
198	depends on EROFS_FS_ZIP && EROFS_FS_PCPU_KTHREAD
199	default y
200	help
201	  This permits EROFS to configure per-CPU kthread workers to run
202	  at higher priority.
203
204	  If unsure, say N.
205
206config EROFS_FS_PAGE_CACHE_SHARE
207	bool "EROFS page cache share support (experimental)"
208	depends on EROFS_FS && EROFS_FS_XATTR
209	select FS_STACK
210	help
211	  This enables page cache sharing among inodes with identical
212	  content fingerprints on the same machine.
213
214	  If unsure, say N.
215