btrfs-progs: image: don't create unused threads
In case of creating an image without compression, we don't need to create unused threads. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
50ef0322b4
commit
de554435e8
|
@ -2786,12 +2786,15 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if ((compress_level > 0 || create == 0) &&
|
||||
num_threads == 0) {
|
||||
if (compress_level > 0 || create == 0) {
|
||||
if (num_threads == 0) {
|
||||
num_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (num_threads <= 0)
|
||||
num_threads = 1;
|
||||
}
|
||||
} else {
|
||||
num_threads = 0;
|
||||
}
|
||||
|
||||
if (create) {
|
||||
ret = check_mounted(source);
|
||||
|
|
Loading…
Reference in New Issue