summaryrefslogtreecommitdiff
path: root/btrfs-image.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-image.c')
-rw-r--r--btrfs-image.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/btrfs-image.c b/btrfs-image.c
index 630fdf8..6eddbd5 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -2690,7 +2690,7 @@ int main(int argc, char *argv[])
{
char *source;
char *target;
- u64 num_threads = 1;
+ u64 num_threads = 0;
u64 compress_level = 0;
int create = 1;
int old_restore = 0;
@@ -2786,7 +2786,8 @@ int main(int argc, char *argv[])
}
}
- if (num_threads == 1 && compress_level > 0) {
+ if ((compress_level > 0 || create == 0) &&
+ num_threads == 0) {
num_threads = sysconf(_SC_NPROCESSORS_ONLN);
if (num_threads <= 0)
num_threads = 1;