aboutsummaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 18:57:11 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-18 22:44:39 +0200
commit58c5d7c933a714096ef0dd42bd1446a6e1a25a16 (patch)
tree7d85549573db5af868c5b6877a75490f581ff3ac /tar
parent64322709a908560f6d08ffc6f50a42f1c1be51dc (diff)
Make data writer use block processor
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tar')
-rw-r--r--tar/tar2sqfs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index f583fd4..ed3aea1 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -30,6 +30,7 @@ static struct option long_opts[] = {
{ "block-size", required_argument, NULL, 'b' },
{ "dev-block-size", required_argument, NULL, 'B' },
{ "defaults", required_argument, NULL, 'd' },
+ { "num-jobs", required_argument, NULL, 'j' },
{ "comp-extra", required_argument, NULL, 'X' },
{ "no-skip", no_argument, NULL, 's' },
{ "no-xattr", no_argument, NULL, 'x' },
@@ -41,7 +42,7 @@ static struct option long_opts[] = {
{ "version", no_argument, NULL, 'V' },
};
-static const char *short_opts = "c:b:B:d:X:sxekfqhV";
+static const char *short_opts = "c:b:B:d:X:j:sxekfqhV";
static const char *usagestr =
"Usage: tar2sqfs [OPTIONS...] <sqfsfile>\n"
@@ -56,6 +57,7 @@ static const char *usagestr =
" --comp-extra, -X <options> A comma seperated list of extra options for\n"
" the selected compressor. Specify 'help' to\n"
" get a list of available options.\n"
+" --num-jobs, -j <count> Number of compressor jobs to create.\n"
" --block-size, -b <size> Block size to use for Squashfs image.\n"
" Defaults to %u.\n"
" --dev-block-size, -B <size> Device block size to padd the image to.\n"
@@ -92,6 +94,7 @@ static int block_size = SQFS_DEFAULT_BLOCK_SIZE;
static size_t devblksize = SQFS_DEVBLK_SIZE;
static bool quiet = false;
static int outmode = O_WRONLY | O_CREAT | O_EXCL;
+static unsigned int num_jobs = 1;
static E_SQFS_COMPRESSOR comp_id;
static char *comp_extra = NULL;
static char *fs_defaults = NULL;
@@ -139,6 +142,9 @@ static void process_args(int argc, char **argv)
exit(EXIT_FAILURE);
}
break;
+ case 'j':
+ num_jobs = strtol(optarg, NULL, 0);
+ break;
case 'X':
comp_extra = optarg;
break;
@@ -387,7 +393,7 @@ int main(int argc, char **argv)
super.bytes_used += ret;
}
- data = data_writer_create(&super, cmp, outfd, devblksize);
+ data = data_writer_create(&super, cmp, outfd, devblksize, num_jobs);
if (data == NULL)
goto out_cmp;