ubifs: Default to zstd compression
authorRui Salvaterra <rsalvaterra@gmail.com>
Mon, 5 Apr 2021 15:29:35 +0000 (16:29 +0100)
committerRichard Weinberger <richard@nod.at>
Thu, 15 Apr 2021 20:00:26 +0000 (22:00 +0200)
Compared to lzo and zlib, zstd is the best all-around performer, both in terms
of speed and compression ratio. Set it as the default, if available.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/sb.c

index c160f71..e7693b9 100644 (file)
@@ -53,6 +53,9 @@
 
 static int get_default_compressor(struct ubifs_info *c)
 {
+       if (ubifs_compr_present(c, UBIFS_COMPR_ZSTD))
+               return UBIFS_COMPR_ZSTD;
+
        if (ubifs_compr_present(c, UBIFS_COMPR_LZO))
                return UBIFS_COMPR_LZO;