mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-27 08:32:20 +00:00
btrfs-progs: image: add symbolic constant for max thread count
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
9459a505d0
commit
84f9e8cfe3
@ -44,6 +44,8 @@
|
||||
#define COMPRESS_NONE 0
|
||||
#define COMPRESS_ZLIB 1
|
||||
|
||||
#define MAX_WORKER_THREADS (32)
|
||||
|
||||
struct meta_cluster_item {
|
||||
__le64 bytenr;
|
||||
__le32 size;
|
||||
@ -2761,9 +2763,10 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case 't':
|
||||
num_threads = arg_strtou64(optarg);
|
||||
if (num_threads > 32) {
|
||||
error("number of threads out of range: %llu",
|
||||
(unsigned long long)num_threads);
|
||||
if (num_threads > MAX_WORKER_THREADS) {
|
||||
error("number of threads out of range: %llu > %d",
|
||||
(unsigned long long)num_threads,
|
||||
MAX_WORKER_THREADS);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user