Skip to content

Commit

Permalink
Merge tag 'pstore-v4.17-rc1' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/kees/linux

Pull pstore updates from Kees Cook:
 "This cycle was almost entirely improvements to the pstore compression
  options, noted below:

   - Add lz4hc and 842 to pstore compression options (Geliang Tang)

   - Refactor to use crypto compression API (Geliang Tang)

   - Fix up Kconfig dependencies for compression (Arnd Bergmann)

   - Allow for run-time compression selection

   - Remove stack VLA usage"

* tag 'pstore-v4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore: fix crypto dependencies
  pstore: Use crypto compress API
  pstore/ram: Do not use stack VLA for parity workspace
  pstore: Select compression at runtime
  pstore: Avoid size casts for 842 compression
  pstore: Add lz4hc and 842 compression support
  • Loading branch information
torvalds committed Apr 6, 2018
2 parents 3b54765 + 58eb5b6 commit 69824bc
Show file tree
Hide file tree
Showing 7 changed files with 226 additions and 284 deletions.
101 changes: 78 additions & 23 deletions fs/pstore/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config PSTORE
tristate "Persistent store support"
select CRYPTO if PSTORE_COMPRESS
default n
help
This option enables generic access to platform level
Expand All @@ -12,35 +13,89 @@ config PSTORE
If you don't have a platform persistent store driver,
say N.

choice
prompt "Choose compression algorithm"
depends on PSTORE
default PSTORE_ZLIB_COMPRESS
help
This option chooses compression algorithm.

config PSTORE_ZLIB_COMPRESS
bool "ZLIB"
select ZLIB_DEFLATE
select ZLIB_INFLATE
help
This option enables ZLIB compression algorithm support.
config PSTORE_DEFLATE_COMPRESS
tristate "DEFLATE (ZLIB) compression"
default y
depends on PSTORE
select CRYPTO_DEFLATE
help
This option enables DEFLATE (also known as ZLIB) compression
algorithm support.

config PSTORE_LZO_COMPRESS
bool "LZO"
select LZO_COMPRESS
select LZO_DECOMPRESS
help
This option enables LZO compression algorithm support.
tristate "LZO compression"
depends on PSTORE
select CRYPTO_LZO
help
This option enables LZO compression algorithm support.

config PSTORE_LZ4_COMPRESS
bool "LZ4"
select LZ4_COMPRESS
select LZ4_DECOMPRESS
help
This option enables LZ4 compression algorithm support.
tristate "LZ4 compression"
depends on PSTORE
select CRYPTO_LZ4
help
This option enables LZ4 compression algorithm support.

config PSTORE_LZ4HC_COMPRESS
tristate "LZ4HC compression"
depends on PSTORE
select CRYPTO_LZ4HC
help
This option enables LZ4HC (high compression) mode algorithm.

config PSTORE_842_COMPRESS
bool "842 compression"
depends on PSTORE
select CRYPTO_842
help
This option enables 842 compression algorithm support.

config PSTORE_COMPRESS
def_bool y
depends on PSTORE
depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS || \
PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \
PSTORE_842_COMPRESS

choice
prompt "Default pstore compression algorithm"
depends on PSTORE_COMPRESS
help
This option chooses the default active compression algorithm.
This change be changed at boot with "pstore.compress=..." on
the kernel command line.

Currently, pstore has support for 5 compression algorithms:
deflate, lzo, lz4, lz4hc and 842.

The default compression algorithm is deflate.

config PSTORE_DEFLATE_COMPRESS_DEFAULT
bool "deflate" if PSTORE_DEFLATE_COMPRESS

config PSTORE_LZO_COMPRESS_DEFAULT
bool "lzo" if PSTORE_LZO_COMPRESS

config PSTORE_LZ4_COMPRESS_DEFAULT
bool "lz4" if PSTORE_LZ4_COMPRESS

config PSTORE_LZ4HC_COMPRESS_DEFAULT
bool "lz4hc" if PSTORE_LZ4HC_COMPRESS

config PSTORE_842_COMPRESS_DEFAULT
bool "842" if PSTORE_842_COMPRESS

endchoice

config PSTORE_COMPRESS_DEFAULT
string
depends on PSTORE_COMPRESS
default "deflate" if PSTORE_DEFLATE_COMPRESS_DEFAULT
default "lzo" if PSTORE_LZO_COMPRESS_DEFAULT
default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT
default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT
default "842" if PSTORE_842_COMPRESS_DEFAULT

config PSTORE_CONSOLE
bool "Log kernel console messages"
depends on PSTORE
Expand Down
2 changes: 2 additions & 0 deletions fs/pstore/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ static int __init init_pstore_fs(void)
{
int err;

pstore_choose_compression();

/* Create a convenient mount point for people to access pstore */
err = sysfs_create_mount_point(fs_kobj, "pstore");
if (err)
Expand Down
3 changes: 3 additions & 0 deletions fs/pstore/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ extern bool pstore_is_mounted(void);
extern void pstore_record_init(struct pstore_record *record,
struct pstore_info *psi);

/* Called during module_init() */
extern void __init pstore_choose_compression(void);

#endif
Loading

0 comments on commit 69824bc

Please sign in to comment.