18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ciconfig SQUASHFS
38c2ecf20Sopenharmony_ci	tristate "SquashFS 4.0 - Squashed file system support"
48c2ecf20Sopenharmony_ci	depends on BLOCK
58c2ecf20Sopenharmony_ci	help
68c2ecf20Sopenharmony_ci	  Saying Y here includes support for SquashFS 4.0 (a Compressed
78c2ecf20Sopenharmony_ci	  Read-Only File System).  Squashfs is a highly compressed read-only
88c2ecf20Sopenharmony_ci	  filesystem for Linux.  It uses zlib, lzo or xz compression to
98c2ecf20Sopenharmony_ci	  compress both files, inodes and directories.  Inodes in the system
108c2ecf20Sopenharmony_ci	  are very small and all blocks are packed to minimise data overhead.
118c2ecf20Sopenharmony_ci	  Block sizes greater than 4K are supported up to a maximum of 1 Mbytes
128c2ecf20Sopenharmony_ci	  (default block size 128K).  SquashFS 4.0 supports 64 bit filesystems
138c2ecf20Sopenharmony_ci	  and files (larger than 4GB), full uid/gid information, hard links and
148c2ecf20Sopenharmony_ci	  timestamps.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci	  Squashfs is intended for general read-only filesystem use, for
178c2ecf20Sopenharmony_ci	  archival use (i.e. in cases where a .tar.gz file may be used), and in
188c2ecf20Sopenharmony_ci	  embedded systems where low overhead is needed.  Further information
198c2ecf20Sopenharmony_ci	  and tools are available from http://squashfs.sourceforge.net.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci	  If you want to compile this as a module ( = code which can be
228c2ecf20Sopenharmony_ci	  inserted in and removed from the running kernel whenever you want),
238c2ecf20Sopenharmony_ci	  say M here.  The module will be called squashfs.  Note that the root
248c2ecf20Sopenharmony_ci	  file system (the one containing the directory /) cannot be compiled
258c2ecf20Sopenharmony_ci	  as a module.
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci	  If unsure, say N.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_cichoice
308c2ecf20Sopenharmony_ci	prompt "File decompression options"
318c2ecf20Sopenharmony_ci	depends on SQUASHFS
328c2ecf20Sopenharmony_ci	help
338c2ecf20Sopenharmony_ci	  Squashfs now supports two options for decompressing file
348c2ecf20Sopenharmony_ci	  data.  Traditionally Squashfs has decompressed into an
358c2ecf20Sopenharmony_ci	  intermediate buffer and then memcopied it into the page cache.
368c2ecf20Sopenharmony_ci	  Squashfs now supports the ability to decompress directly into
378c2ecf20Sopenharmony_ci	  the page cache.
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci	  If unsure, select "Decompress file data into an intermediate buffer"
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ciconfig SQUASHFS_FILE_CACHE
428c2ecf20Sopenharmony_ci	bool "Decompress file data into an intermediate buffer"
438c2ecf20Sopenharmony_ci	help
448c2ecf20Sopenharmony_ci	  Decompress file data into an intermediate buffer and then
458c2ecf20Sopenharmony_ci	  memcopy it into the page cache.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciconfig SQUASHFS_FILE_DIRECT
488c2ecf20Sopenharmony_ci	bool "Decompress files directly into the page cache"
498c2ecf20Sopenharmony_ci	help
508c2ecf20Sopenharmony_ci	  Directly decompress file data into the page cache.
518c2ecf20Sopenharmony_ci	  Doing so can significantly improve performance because
528c2ecf20Sopenharmony_ci	  it eliminates a memcpy and it also removes the lock contention
538c2ecf20Sopenharmony_ci	  on the single buffer.
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciendchoice
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_cichoice
588c2ecf20Sopenharmony_ci	prompt "Decompressor parallelisation options"
598c2ecf20Sopenharmony_ci	depends on SQUASHFS
608c2ecf20Sopenharmony_ci	help
618c2ecf20Sopenharmony_ci	  Squashfs now supports three parallelisation options for
628c2ecf20Sopenharmony_ci	  decompression.  Each one exhibits various trade-offs between
638c2ecf20Sopenharmony_ci	  decompression performance and CPU and memory usage.
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	  If in doubt, select "Single threaded compression"
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ciconfig SQUASHFS_DECOMP_SINGLE
688c2ecf20Sopenharmony_ci	bool "Single threaded compression"
698c2ecf20Sopenharmony_ci	help
708c2ecf20Sopenharmony_ci	  Traditionally Squashfs has used single-threaded decompression.
718c2ecf20Sopenharmony_ci	  Only one block (data or metadata) can be decompressed at any
728c2ecf20Sopenharmony_ci	  one time.  This limits CPU and memory usage to a minimum.
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciconfig SQUASHFS_DECOMP_MULTI
758c2ecf20Sopenharmony_ci	bool "Use multiple decompressors for parallel I/O"
768c2ecf20Sopenharmony_ci	help
778c2ecf20Sopenharmony_ci	  By default Squashfs uses a single decompressor but it gives
788c2ecf20Sopenharmony_ci	  poor performance on parallel I/O workloads when using multiple CPU
798c2ecf20Sopenharmony_ci	  machines due to waiting on decompressor availability.
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	  If you have a parallel I/O workload and your system has enough memory,
828c2ecf20Sopenharmony_ci	  using this option may improve overall I/O performance.
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci	  This decompressor implementation uses up to two parallel
858c2ecf20Sopenharmony_ci	  decompressors per core.  It dynamically allocates decompressors
868c2ecf20Sopenharmony_ci	  on a demand basis.
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ciconfig SQUASHFS_DECOMP_MULTI_PERCPU
898c2ecf20Sopenharmony_ci	bool "Use percpu multiple decompressors for parallel I/O"
908c2ecf20Sopenharmony_ci	help
918c2ecf20Sopenharmony_ci	  By default Squashfs uses a single decompressor but it gives
928c2ecf20Sopenharmony_ci	  poor performance on parallel I/O workloads when using multiple CPU
938c2ecf20Sopenharmony_ci	  machines due to waiting on decompressor availability.
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci	  This decompressor implementation uses a maximum of one
968c2ecf20Sopenharmony_ci	  decompressor per core.  It uses percpu variables to ensure
978c2ecf20Sopenharmony_ci	  decompression is load-balanced across the cores.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ciendchoice
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciconfig SQUASHFS_XATTR
1028c2ecf20Sopenharmony_ci	bool "Squashfs XATTR support"
1038c2ecf20Sopenharmony_ci	depends on SQUASHFS
1048c2ecf20Sopenharmony_ci	help
1058c2ecf20Sopenharmony_ci	  Saying Y here includes support for extended attributes (xattrs).
1068c2ecf20Sopenharmony_ci	  Xattrs are name:value pairs associated with inodes by
1078c2ecf20Sopenharmony_ci	  the kernel or by users (see the attr(5) manual page).
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci	  If unsure, say N.
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciconfig SQUASHFS_ZLIB
1128c2ecf20Sopenharmony_ci	bool "Include support for ZLIB compressed file systems"
1138c2ecf20Sopenharmony_ci	depends on SQUASHFS
1148c2ecf20Sopenharmony_ci	select ZLIB_INFLATE
1158c2ecf20Sopenharmony_ci	default y
1168c2ecf20Sopenharmony_ci	help
1178c2ecf20Sopenharmony_ci	  ZLIB compression is the standard compression used by Squashfs
1188c2ecf20Sopenharmony_ci	  file systems.  It offers a good trade-off between compression
1198c2ecf20Sopenharmony_ci	  achieved and the amount of CPU time and memory necessary to
1208c2ecf20Sopenharmony_ci	  compress and decompress.
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci	  If unsure, say Y.
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ciconfig SQUASHFS_LZ4
1258c2ecf20Sopenharmony_ci	bool "Include support for LZ4 compressed file systems"
1268c2ecf20Sopenharmony_ci	depends on SQUASHFS
1278c2ecf20Sopenharmony_ci	select LZ4_DECOMPRESS
1288c2ecf20Sopenharmony_ci	help
1298c2ecf20Sopenharmony_ci	  Saying Y here includes support for reading Squashfs file systems
1308c2ecf20Sopenharmony_ci	  compressed with LZ4 compression.  LZ4 compression is mainly
1318c2ecf20Sopenharmony_ci	  aimed at embedded systems with slower CPUs where the overheads
1328c2ecf20Sopenharmony_ci	  of zlib are too high.
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci	  LZ4 is not the standard compression used in Squashfs and so most
1358c2ecf20Sopenharmony_ci	  file systems will be readable without selecting this option.
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci	  If unsure, say N.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ciconfig SQUASHFS_LZO
1408c2ecf20Sopenharmony_ci	bool "Include support for LZO compressed file systems"
1418c2ecf20Sopenharmony_ci	depends on SQUASHFS
1428c2ecf20Sopenharmony_ci	select LZO_DECOMPRESS
1438c2ecf20Sopenharmony_ci	help
1448c2ecf20Sopenharmony_ci	  Saying Y here includes support for reading Squashfs file systems
1458c2ecf20Sopenharmony_ci	  compressed with LZO compression.  LZO compression is mainly
1468c2ecf20Sopenharmony_ci	  aimed at embedded systems with slower CPUs where the overheads
1478c2ecf20Sopenharmony_ci	  of zlib are too high.
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci	  LZO is not the standard compression used in Squashfs and so most
1508c2ecf20Sopenharmony_ci	  file systems will be readable without selecting this option.
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci	  If unsure, say N.
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ciconfig SQUASHFS_XZ
1558c2ecf20Sopenharmony_ci	bool "Include support for XZ compressed file systems"
1568c2ecf20Sopenharmony_ci	depends on SQUASHFS
1578c2ecf20Sopenharmony_ci	select XZ_DEC
1588c2ecf20Sopenharmony_ci	help
1598c2ecf20Sopenharmony_ci	  Saying Y here includes support for reading Squashfs file systems
1608c2ecf20Sopenharmony_ci	  compressed with XZ compression.  XZ gives better compression than
1618c2ecf20Sopenharmony_ci	  the default zlib compression, at the expense of greater CPU and
1628c2ecf20Sopenharmony_ci	  memory overhead.
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci	  XZ is not the standard compression used in Squashfs and so most
1658c2ecf20Sopenharmony_ci	  file systems will be readable without selecting this option.
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci	  If unsure, say N.
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ciconfig SQUASHFS_ZSTD
1708c2ecf20Sopenharmony_ci	bool "Include support for ZSTD compressed file systems"
1718c2ecf20Sopenharmony_ci	depends on SQUASHFS
1728c2ecf20Sopenharmony_ci	select ZSTD_DECOMPRESS
1738c2ecf20Sopenharmony_ci	help
1748c2ecf20Sopenharmony_ci	  Saying Y here includes support for reading Squashfs file systems
1758c2ecf20Sopenharmony_ci	  compressed with ZSTD compression.  ZSTD gives better compression than
1768c2ecf20Sopenharmony_ci	  the default ZLIB compression, while using less CPU.
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci	  ZSTD is not the standard compression used in Squashfs and so most
1798c2ecf20Sopenharmony_ci	  file systems will be readable without selecting this option.
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci	  If unsure, say N.
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ciconfig SQUASHFS_4K_DEVBLK_SIZE
1848c2ecf20Sopenharmony_ci	bool "Use 4K device block size?"
1858c2ecf20Sopenharmony_ci	depends on SQUASHFS
1868c2ecf20Sopenharmony_ci	help
1878c2ecf20Sopenharmony_ci	  By default Squashfs sets the dev block size (sb_min_blocksize)
1888c2ecf20Sopenharmony_ci	  to 1K or the smallest block size supported by the block device
1898c2ecf20Sopenharmony_ci	  (if larger).  This, because blocks are packed together and
1908c2ecf20Sopenharmony_ci	  unaligned in Squashfs, should reduce latency.
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci	  This, however, gives poor performance on MTD NAND devices where
1938c2ecf20Sopenharmony_ci	  the optimal I/O size is 4K (even though the devices can support
1948c2ecf20Sopenharmony_ci	  smaller block sizes).
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci	  Using a 4K device block size may also improve overall I/O
1978c2ecf20Sopenharmony_ci	  performance for some file access patterns (e.g. sequential
1988c2ecf20Sopenharmony_ci	  accesses of files in filesystem order) on all media.
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci	  Setting this option will force Squashfs to use a 4K device block
2018c2ecf20Sopenharmony_ci	  size by default.
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	  If unsure, say N.
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ciconfig SQUASHFS_EMBEDDED
2068c2ecf20Sopenharmony_ci	bool "Additional option for memory-constrained systems"
2078c2ecf20Sopenharmony_ci	depends on SQUASHFS
2088c2ecf20Sopenharmony_ci	help
2098c2ecf20Sopenharmony_ci	  Saying Y here allows you to specify cache size.
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci	  If unsure, say N.
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ciconfig SQUASHFS_FRAGMENT_CACHE_SIZE
2148c2ecf20Sopenharmony_ci	int "Number of fragments cached" if SQUASHFS_EMBEDDED
2158c2ecf20Sopenharmony_ci	depends on SQUASHFS
2168c2ecf20Sopenharmony_ci	default "3"
2178c2ecf20Sopenharmony_ci	help
2188c2ecf20Sopenharmony_ci	  By default SquashFS caches the last 3 fragments read from
2198c2ecf20Sopenharmony_ci	  the filesystem.  Increasing this amount may mean SquashFS
2208c2ecf20Sopenharmony_ci	  has to re-read fragments less often from disk, at the expense
2218c2ecf20Sopenharmony_ci	  of extra system memory.  Decreasing this amount will mean
2228c2ecf20Sopenharmony_ci	  SquashFS uses less memory at the expense of extra reads from disk.
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci	  Note there must be at least one cached fragment.  Anything
2258c2ecf20Sopenharmony_ci	  much more than three will probably not make much difference.
226