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>
}
}
- if ((compress_level > 0 || create == 0) &&
- num_threads == 0) {
- num_threads = sysconf(_SC_NPROCESSORS_ONLN);
- if (num_threads <= 0)
- num_threads = 1;
+ 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) {