diff --git a/Documentation/btrfs-man5.asciidoc b/Documentation/btrfs-man5.asciidoc index 6a1a04b7..3b8a9672 100644 --- a/Documentation/btrfs-man5.asciidoc +++ b/Documentation/btrfs-man5.asciidoc @@ -125,10 +125,10 @@ The upper bound is not forced, but a warning is printed if it's more than 300 seconds (5 minutes). Use with care. *compress*:: -*compress='type'*:: +*compress='type[:level]'*:: *compress-force*:: -*compress-force='type'*:: -(default: off) +*compress-force='type[:level]'*:: +(default: off, level support since: 5.1) + Control BTRFS file data compression. Type may be specified as 'zlib', 'lzo', 'zstd' or 'no' (for no compression, used for remounting). If no type @@ -136,6 +136,13 @@ is specified, 'zlib' is used. If 'compress-force' is specified, then compression will always be attempted, but the data may end up uncompressed if the compression would make them larger. + +Both 'zlib' and 'zstd' (since version 5.1) expose the compression level as a +tunable knob with higher levels trading speed and memory ('zstd') for higher +compression ratios. This can be set by appending a colon and the desired level. +Zlib accepts the range [1, 9] and zstd accepts [1, 15]. If no level is set, +both currently use a default level of 3. The value 0 is an alias for the defaul +level. ++ Otherwise some simple heuristics are applied to detect an incompressible file. If the first blocks written to a file are not compressible, the whole file is permanently marked to skip compression. As this is too simple, the