diff options
author | htyuxe+dhbrei4sq0df8@grr.la <htyuxe+dhbrei4sq0df8@grr.la> | 2019-09-29 19:44:14 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@aol.com> | 2019-10-15 23:59:10 +0800 |
commit | 47d6895a5ff9e7fc90d8e4143077b17dbb7a587e (patch) | |
tree | fac8cd3a5cd60e76d6cc57cf5aa18579eb593f98 /mkfs | |
parent | 0e91d131dcb21b45b21762c77c6d0377fa16f80d (diff) |
erofs-utils: introduce inline xattr support
Load xattrs from source files and pack them into target image.
Link: https://lore.kernel.org/r/20191014114206.590-1-hsiangkao@aol.com
Signed-off-by: htyuxe+dhbrei4sq0df8@grr.la <htyuxe+dhbrei4sq0df8@grr.la>
Signed-off-by: Li Guifu <blucerlee@gmail.com>
Signed-off-by: Gao Xiang <hsiangkao@aol.com>
Diffstat (limited to 'mkfs')
-rw-r--r-- | mkfs/main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mkfs/main.c b/mkfs/main.c index 536b784..0df2a96 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -28,6 +28,7 @@ static void usage(void) fprintf(stderr, "Generate erofs image from DIRECTORY to FILE, and [options] are:\n"); fprintf(stderr, " -zX[,Y] X=compressor (Y=compression level, optional)\n"); fprintf(stderr, " -d# set output message level to # (maximum 9)\n"); + fprintf(stderr, " -x# set xattr tolerance to # (< 0, disable xattrs; default 1)\n"); fprintf(stderr, " -EX[,...] X=extended options\n"); fprintf(stderr, " -T# set a fixed UNIX timestamp # to all files\n"); } @@ -94,7 +95,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[]) char *endptr; int opt, i; - while ((opt = getopt(argc, argv, "d:z:E:T:")) != -1) { + while ((opt = getopt(argc, argv, "d:x:z:E:T:")) != -1) { switch (opt) { case 'z': if (!optarg) { @@ -122,6 +123,15 @@ static int mkfs_parse_options_cfg(int argc, char *argv[]) cfg.c_dbg_lvl = i; break; + case 'x': + i = strtol(optarg, &endptr, 0); + if (*endptr != '\0') { + erofs_err("invalid xattr tolerance %s", optarg); + return -EINVAL; + } + cfg.c_inline_xattr_tolerance = i; + break; + case 'E': opt = parse_extended_opts(optarg); if (opt) |