bcachefs: Compression levels
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 13 Jul 2023 02:27:16 +0000 (22:27 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:07 +0000 (17:10 -0400)
commit986e9842fb6825f65918ed400b29c8c878359b7a
tree6a20a085db8f8c557879461c2154ee8f1790f4a3
parente86e9124ca6c762f02cc412ce71feb9ed2e4890d
bcachefs: Compression levels

This allows including a compression level when specifying a compression
type, e.g.
  compression=zstd:15

Values from 1 through 15 indicate compression levels, 0 or unspecified
indicates the default.

For LZ4, values 3-15 specify that the HC algorithm should be used.

Note that for compatibility, extents themselves only include the
compression type, not the compression level. This means that specifying
the same compression algorithm but different compression levels for the
compression and background_compression options will have no effect.

XXX: perhaps we could add a warning for this

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/Kconfig
fs/bcachefs/checksum.h
fs/bcachefs/compress.c
fs/bcachefs/compress.h
fs/bcachefs/data_update.c
fs/bcachefs/io.c
fs/bcachefs/io.h
fs/bcachefs/io_types.h
fs/bcachefs/opts.h
fs/bcachefs/rebalance.c