1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 18:53:52 +02:00

kernel: default to zstd compression in ubifs

Compared to both lzo and zlib, zstd is the best all-around performer. Backport
a kernel patch [1] (to both 5.4 and 5.10), in order to set it as default for
ubifs, if available.

[1] https://lore.kernel.org/linux-mtd/CAFLxGvwhtRY-6kT-sN=AgjvyssHb5qdTS6WQHkhKu3YrPuTkdw@mail.gmail.com/

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
This commit is contained in:
Rui Salvaterra 2021-04-05 16:45:47 +01:00
parent 53546c3e94
commit c4d39c4d5f
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From dcdf415b740923530dc71d89fecc8361078473f5 Mon Sep 17 00:00:00 2001
From: Rui Salvaterra <rsalvaterra@gmail.com>
Date: Mon, 5 Apr 2021 16:11:55 +0100
Subject: [PATCH] ubifs: default to zstd compression
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>
---
fs/ubifs/sb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
@@ -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;

View File

@ -0,0 +1,25 @@
From dcdf415b740923530dc71d89fecc8361078473f5 Mon Sep 17 00:00:00 2001
From: Rui Salvaterra <rsalvaterra@gmail.com>
Date: Mon, 5 Apr 2021 16:11:55 +0100
Subject: [PATCH] ubifs: default to zstd compression
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>
---
fs/ubifs/sb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/ubifs/sb.c
+++ b/fs/ubifs/sb.c
@@ -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;