Skip to content

Commit

Permalink
cmake: Enable multi-threading compression
Browse files Browse the repository at this point in the history
Signed-off-by: sekaiacg <[email protected]>
  • Loading branch information
sekaiacg committed Jan 26, 2025
1 parent f391fcc commit ca8d4e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build/cmake/lib/liberofs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ set(liberofs_include_list
"linux/fs.h"
"linux/types.h"
"linux/xattr.h"
"pthread.h"
"sys/ioctl.h"
"sys/sysmacros.h"
"unistd.h"
)

set(liberofs_function_list
"backtrace"
"utimensat"
"sysconf"
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
list(APPEND liberofs_include_list
Expand Down Expand Up @@ -67,6 +70,7 @@ set(LIBEROFS_STATIC_DEFAULTS_CFLAGS
"-DHAVE_ZLIB"
"-DHAVE_LIBLZMA"
"-DWITH_ANDROID"
"-DEROFS_MT_ENABLED"
"${DARWIN_CFLAGS}"
CACHE INTERNAL "liberofs_static_defaults_cflags"
)
Expand Down Expand Up @@ -104,6 +108,7 @@ set(liberofs_srcs
"${TARGET_SRC_DIR}/compressor_liblzma.c"
"${TARGET_SRC_DIR}/kite_deflate.c"
"${TARGET_SRC_DIR}/compressor_deflate.c"
"${TARGET_SRC_DIR}/workqueue.c"
)

include(CheckCXXCompilerFlag)
Expand Down
3 changes: 3 additions & 0 deletions build/cmake/lib/liberofs_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
#cmakedefine HAVE_LINUX_FS_H 1
#cmakedefine HAVE_LINUX_TYPES_H 1
#cmakedefine HAVE_LINUX_XATTR_H 1
#cmakedefine HAVE_PTHREAD_H 1
#cmakedefine HAVE_SYS_IOCTL_H 1
#cmakedefine HAVE_SYS_SYSMACROS_H 1
#cmakedefine HAVE_SYS_RANDOM_H 1
#cmakedefine HAVE_UNISTD_H 1

// Functions
#cmakedefine HAVE_BACKTRACE 1
Expand All @@ -24,6 +26,7 @@
#cmakedefine HAVE_PWRITE64 1
#cmakedefine HAVE_POSIX_FADVISE 1
#cmakedefine HAVE_TMPFILE64 1
#cmakedefine HAVE_SYSCONF 1
#cmakedefine HAVE_UTIMENSAT 1

// Symbols
Expand Down
2 changes: 1 addition & 1 deletion mkfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
#ifdef EROFS_MT_ENABLED
case 520: {
unsigned int processors;

errno = 0;
cfg.c_mt_workers = strtoul(optarg, &endptr, 0);
if (errno || *endptr != '\0') {
erofs_err("invalid worker number %s", optarg);
Expand Down

0 comments on commit ca8d4e6

Please sign in to comment.