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

Reply via email to