From: Gao Xiang via Linux-erofs <linux-erofs@lists.ozlabs.org>
To: linux-erofs@lists.ozlabs.org
Subject: [RFC PATCH v0 1/3] erofs-utils: add -C# for the maximum size of pclusters
Date: Wed, 30 Dec 2020 16:47:26 +0800 [thread overview]
Message-ID: <20201230084728.813-2-hsiangkao@aol.com> (raw)
In-Reply-To: <20201230084728.813-1-hsiangkao@aol.com>
From: Gao Xiang <hsiangkao@aol.com>
Set up -C >= EROFS_BLKSIZ (more specifically, >= lclustersize)
to enable big pcluster feature.
Signed-off-by: Gao Xiang <hsiangkao@aol.com>
---
include/erofs/config.h | 2 ++
lib/config.c | 1 +
mkfs/main.c | 14 +++++++++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/erofs/config.h b/include/erofs/config.h
index 02ddf594ca60..5f5a05a8b796 100644
--- a/include/erofs/config.h
+++ b/include/erofs/config.h
@@ -53,6 +53,8 @@ struct erofs_configure {
int c_force_inodeversion;
/* < 0, xattr disabled and INT_MAX, always use inline xattrs */
int c_inline_xattr_tolerance;
+
+ u32 c_physical_clusterblks;
u64 c_unix_timestamp;
#ifdef WITH_ANDROID
char *mount_point;
diff --git a/lib/config.c b/lib/config.c
index 3ecd48140cfd..352a77c8d639 100644
--- a/lib/config.c
+++ b/lib/config.c
@@ -24,6 +24,7 @@ void erofs_init_configure(void)
cfg.c_force_inodeversion = 0;
cfg.c_inline_xattr_tolerance = 2;
cfg.c_unix_timestamp = -1;
+ cfg.c_physical_clusterblks = 1;
}
void erofs_show_config(void)
diff --git a/mkfs/main.c b/mkfs/main.c
index abd48be0fa4f..c4c67c962919 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -62,6 +62,7 @@ static void usage(void)
fputs("usage: [options] FILE DIRECTORY\n\n"
"Generate erofs image from DIRECTORY to FILE, and [options] are:\n"
" -zX[,Y] X=compressor (Y=compression level, optional)\n"
+ " -C# specify the size of compress physical cluster in bytes\n"
" -d# set output message level to # (maximum 9)\n"
" -x# set xattr tolerance to # (< 0, disable xattrs; default 2)\n"
" -EX[,...] X=extended options\n"
@@ -152,7 +153,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
char *endptr;
int opt, i;
- while((opt = getopt_long(argc, argv, "d:x:z:E:T:U:",
+ while((opt = getopt_long(argc, argv, "d:x:z:E:T:U:C:",
long_options, NULL)) != -1) {
switch (opt) {
case 'z':
@@ -248,6 +249,17 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
cfg.fs_config_file = optarg;
break;
#endif
+ case 'C':
+ i = strtoull(optarg, &endptr, 0);
+ if (*endptr != '\0' ||
+ i < EROFS_BLKSIZ || i % EROFS_BLKSIZ) {
+ erofs_err("invalid physical clustersize %s",
+ optarg);
+ return -EINVAL;
+ }
+ cfg.c_physical_clusterblks = i / EROFS_BLKSIZ;
+ break;
+
case 1:
usage();
exit(0);
--
2.24.0
next prev parent reply other threads:[~2020-12-30 8:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201230084728.813-1-hsiangkao.ref@aol.com>
2020-12-30 8:47 ` [RFC PATCH v0 0/3] erofs-utils: support multiple block compression Gao Xiang via Linux-erofs
2020-12-30 8:47 ` Gao Xiang via Linux-erofs [this message]
2020-12-30 8:47 ` [RFC PATCH v0 2/3] erofs-utils: mkfs: " Gao Xiang via Linux-erofs
2020-12-30 8:47 ` [RFC PATCH v0 3/3] erofs-utils: fuse: " Gao Xiang via Linux-erofs
2020-12-30 10:12 ` [RFC PATCH v0 0/3] erofs-utils: " Gao Xiang
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=20201230084728.813-2-hsiangkao@aol.com \
--to=linux-erofs@lists.ozlabs.org \
--cc=hsiangkao@aol.com \
/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 NNTP newsgroup(s).