From 84f9e8cfe34f7df196e5aa147e2b9ae45bc3b4f3 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 3 Nov 2016 00:53:43 +0100 Subject: [PATCH] btrfs-progs: image: add symbolic constant for max thread count Signed-off-by: David Sterba --- btrfs-image.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/btrfs-image.c b/btrfs-image.c index 2c1d591b..3f403015 100644 --- a/btrfs-image.c +++ b/btrfs-image.c @@ -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;