From: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
To: linux-erofs@lists.ozlabs.org
Subject: [PATCH v5 0/2] erofs-utils: mkfs: introduce inter-file multi-threaded compression
Date: Mon, 25 Mar 2024 21:41:40 +0800 [thread overview]
Message-ID: <20240325134142.174389-1-zhaoyifan@sjtu.edu.cn> (raw)
changelog since v4:
- Fix more format issues in inode.c reported by checkpatch.pl
- Add missing cfg.c_chunkbits in erofs_mkfs_issue_compress
Yifan Zhao (2):
erofs-utils: lib: split function logic in inode.c
erofs-utils: mkfs: introduce inter-file multi-threaded compression
include/erofs/compress.h | 16 ++
include/erofs/inode.h | 30 +++
include/erofs/internal.h | 3 +
lib/compress.c | 336 +++++++++++++++++++++------------
lib/inode.c | 397 +++++++++++++++++++++++++++++++++------
5 files changed, 604 insertions(+), 178 deletions(-)
Interdiff against v4:
diff --git a/lib/inode.c b/lib/inode.c
index 0faf461..1de3f8a 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -1152,11 +1152,12 @@ static int erofs_mkfs_handle_file(struct erofs_inode *inode)
static int erofs_mkfs_issue_compress(struct erofs_inode *inode)
{
- if (!inode->i_size || S_ISLNK(inode->i_mode))
+ if (!inode->i_size || S_ISLNK(inode->i_mode) || cfg.c_chunkbits)
return 0;
if (cfg.c_compr_opts[0].alg && erofs_file_is_compressible(inode)) {
int fd = open(inode->i_srcpath, O_RDONLY | O_BINARY);
+
if (fd < 0)
return -errno;
return erofs_write_compressed_file(inode, fd, 0);
@@ -1420,7 +1421,7 @@ static int z_erofs_mt_reap_compressed(struct erofs_inode *inode)
return ret;
}
-static int z_erofs_mt_reap_inodes()
+static int z_erofs_mt_reap_inodes(void)
{
struct erofs_inode *inode, *dumpdir;
int ret = 0;
@@ -1456,6 +1457,7 @@ static int z_erofs_mt_reap_inodes()
ret = 0;
} else {
int fd = open(inode->i_srcpath, O_RDONLY | O_BINARY);
+
if (fd < 0)
return -errno;
--
2.44.0
next reply other threads:[~2024-03-25 13:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 13:41 Yifan Zhao [this message]
2024-03-25 13:41 ` [PATCH v5 1/2] erofs-utils: lib: split function logic in inode.c Yifan Zhao
2024-03-25 13:41 ` [PATCH v5 2/2] erofs-utils: mkfs: introduce inter-file multi-threaded compression Yifan Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240325134142.174389-1-zhaoyifan@sjtu.edu.cn \
--to=zhaoyifan@sjtu.edu.cn \
--cc=linux-erofs@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).