Skip to contentSkip to conversation

erofs-utils: correct the default number of workers in the usage

PATCH New Gao Xiang 1 participant 2 messages May 15, 2024 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/2 erofs-utils: correct the default number of workers in the usage

Fixes 59c36e7a4008 ("erofs-utils: mkfs: use all available processors by default")
---
 mkfs/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mkfs/main.c +2 -2
index 4c3620d..455c152 100644
@@ -187,7 +187,7 @@ static void usage(int argc, char **argv)
 		"                       (and optionally dump the raw stream to X together)\n"
 #endif
 #ifdef EROFS_MT_ENABLED
-		" --workers=#           set the number of worker threads to # (default=1)\n"
+		" --workers=#           set the number of worker threads to # (default: %u)\n"
 #endif
 		" --xattr-prefix=X      X=extra xattr name prefix\n"
 		" --mount-point=X       X=prefix of target fs path (default: /)\n"
@@ -198,7 +198,7 @@ static void usage(int argc, char **argv)
 		" --fs-config-file=X    X=fs_config file\n"
 		" --block-list-file=X   X=block_list file\n"
 #endif
-		);
+		, erofs_get_available_processors() /* --workers= */);
 }
 
 static void version(void)
Signature · 1 line
2.39.3
author
#1 lore raw

PATCH 2/2 erofs-utils: pretty root directory progressinfo

Avoid Processing ... or file dumped (mode 40755)..

---
 lib/inode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/inode.c +3 -3
index 8ec87e6..67a572d 100644
@@ -1405,10 +1405,11 @@ static int erofs_rebuild_handle_directory(struct erofs_inode *dir)
 
 static int erofs_mkfs_handle_inode(struct erofs_inode *inode)
 {
+	const char *relpath = erofs_fspath(inode->i_srcpath);
 	char *trimmed;
 	int ret;
 
-	trimmed = erofs_trim_for_progressinfo(erofs_fspath(inode->i_srcpath),
+	trimmed = erofs_trim_for_progressinfo(relpath[0] ? relpath : "/",
 					      sizeof("Processing  ...") - 1);
 	erofs_update_progressinfo("Processing %s ...", trimmed);
 	free(trimmed);
@@ -1442,8 +1443,7 @@ static int erofs_mkfs_handle_inode(struct erofs_inode *inode)
 	} else {
 		ret = erofs_mkfs_handle_directory(inode);
 	}
-	erofs_info("file %s dumped (mode %05o)", erofs_fspath(inode->i_srcpath),
-		   inode->i_mode);
+	erofs_info("file /%s dumped (mode %05o)", relpath, inode->i_mode);
 	return ret;
 }
 
Signature · 1 line
2.39.3