btrfs-progs: image: add symbolic constant for max thread count

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-11-03 00:53:43 +01:00
parent 9459a505d0
commit 84f9e8cfe3

View File

@ -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;