[openwrt/openwrt] kernel: default to zstd compression in ubifs
LEDE Commits
lede-commits at lists.infradead.org
Wed Apr 21 18:12:58 BST 2021
ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c4d39c4d5f66d5c96131737f7905c96c258d82ba
commit c4d39c4d5f66d5c96131737f7905c96c258d82ba
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Mon Apr 5 16:45:47 2021 +0100
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 at gmail.com>
---
...0-v5.13-ubifs-default-to-zstd-compression.patch | 25 ++++++++++++++++++++++
...0-v5.13-ubifs-default-to-zstd-compression.patch | 25 ++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/target/linux/generic/backport-5.10/500-v5.13-ubifs-default-to-zstd-compression.patch b/target/linux/generic/backport-5.10/500-v5.13-ubifs-default-to-zstd-compression.patch
new file mode 100644
index 0000000000..dd50c19c27
--- /dev/null
+++ b/target/linux/generic/backport-5.10/500-v5.13-ubifs-default-to-zstd-compression.patch
@@ -0,0 +1,25 @@
+From dcdf415b740923530dc71d89fecc8361078473f5 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra <rsalvaterra at 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 at 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;
+
diff --git a/target/linux/generic/backport-5.4/500-v5.13-ubifs-default-to-zstd-compression.patch b/target/linux/generic/backport-5.4/500-v5.13-ubifs-default-to-zstd-compression.patch
new file mode 100644
index 0000000000..dd50c19c27
--- /dev/null
+++ b/target/linux/generic/backport-5.4/500-v5.13-ubifs-default-to-zstd-compression.patch
@@ -0,0 +1,25 @@
+From dcdf415b740923530dc71d89fecc8361078473f5 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra <rsalvaterra at 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 at 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;
+
More information about the lede-commits
mailing list