aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/raidz_test
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-02-16 16:35:00 +0100
committerBrian Behlendorf <[email protected]>2022-02-18 09:34:52 -0800
commitb7c42ce5b28041b45c3dff6cc9ecf55bd83b6087 (patch)
tree4b28d58b84860c107f62099948456e30efaa608e /cmd/raidz_test
parenta215c3e83445c230ced10bc5ed13874c3eaaa20f (diff)
raidz_test: silence unsigned >=0 warnings
Reviewed-by: Alejandro Colomar <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13110
Diffstat (limited to 'cmd/raidz_test')
-rw-r--r--cmd/raidz_test/raidz_test.c9
-rw-r--r--cmd/raidz_test/raidz_test.h16
2 files changed, 14 insertions, 11 deletions
diff --git a/cmd/raidz_test/raidz_test.c b/cmd/raidz_test/raidz_test.c
index b177105ee..a7459d8e2 100644
--- a/cmd/raidz_test/raidz_test.c
+++ b/cmd/raidz_test/raidz_test.c
@@ -71,12 +71,13 @@ static void print_opts(raidz_test_opts_t *opts, boolean_t force)
{
char *verbose;
switch (opts->rto_v) {
- case 0:
+ case D_ALL:
verbose = "no";
break;
- case 1:
+ case D_INFO:
verbose = "info";
break;
+ case D_DEBUG:
default:
verbose = "debug";
break;
@@ -119,7 +120,7 @@ static void usage(boolean_t requested)
"\t[-B benchmark all raidz implementations]\n"
"\t[-e use expanded raidz map (default: %s)]\n"
"\t[-r expanded raidz map reflow offset (default: %llx)]\n"
- "\t[-v increase verbosity (default: %zu)]\n"
+ "\t[-v increase verbosity (default: %d)]\n"
"\t[-h (print help)]\n"
"\t[-T test the test, see if failure would be detected]\n"
"\t[-D debug (attach gdb on SIGSEGV)]\n"
@@ -131,7 +132,7 @@ static void usage(boolean_t requested)
rto_opts.rto_sweep ? "yes" : "no", /* -S */
rto_opts.rto_expand ? "yes" : "no", /* -e */
(u_longlong_t)o->rto_expand_offset, /* -r */
- o->rto_v); /* -d */
+ o->rto_v); /* -v */
exit(requested ? 0 : 1);
}
diff --git a/cmd/raidz_test/raidz_test.h b/cmd/raidz_test/raidz_test.h
index 0f7f4cee3..40a8a85e5 100644
--- a/cmd/raidz_test/raidz_test.h
+++ b/cmd/raidz_test/raidz_test.h
@@ -28,7 +28,7 @@
#include <sys/spa.h>
-static const char *raidz_impl_names[] = {
+static const char *const raidz_impl_names[] = {
"original",
"scalar",
"sse2",
@@ -42,12 +42,18 @@ static const char *raidz_impl_names[] = {
NULL
};
+enum raidz_verbosity {
+ D_ALL,
+ D_INFO,
+ D_DEBUG,
+};
+
typedef struct raidz_test_opts {
size_t rto_ashift;
uint64_t rto_offset;
size_t rto_dcols;
size_t rto_dsize;
- size_t rto_v;
+ enum raidz_verbosity rto_v;
size_t rto_sweep;
size_t rto_sweep_timeout;
size_t rto_benchmark;
@@ -68,7 +74,7 @@ static const raidz_test_opts_t rto_opts_defaults = {
.rto_offset = 1ULL << 0,
.rto_dcols = 8,
.rto_dsize = 1<<19,
- .rto_v = 0,
+ .rto_v = D_ALL,
.rto_sweep = 0,
.rto_benchmark = 0,
.rto_expand = 0,
@@ -86,10 +92,6 @@ static inline size_t ilog2(size_t a)
}
-#define D_ALL 0
-#define D_INFO 1
-#define D_DEBUG 2
-
#define LOG(lvl, a...) \
{ \
if (rto_opts.rto_v >= lvl) \