4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or https://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (C) 2016 Gvozden Nešković. All rights reserved.
31 static const char *const raidz_impl_names
[] = {
45 enum raidz_verbosity
{
51 typedef struct raidz_test_opts
{
56 enum raidz_verbosity rto_v
;
58 size_t rto_sweep_timeout
;
61 uint64_t rto_expand_offset
;
65 /* non-user options */
66 boolean_t rto_should_stop
;
69 raidz_map_t
*rm_golden
;
72 static const raidz_test_opts_t rto_opts_defaults
= {
74 .rto_offset
= 1ULL << 0,
81 .rto_expand_offset
= -1ULL,
84 .rto_should_stop
= B_FALSE
87 extern raidz_test_opts_t rto_opts
;
89 static inline size_t ilog2(size_t a
)
91 return (a
> 1 ? 1 + ilog2(a
>> 1) : 0);
95 #define LOG(lvl, ...) \
97 if (rto_opts.rto_v >= lvl) \
98 (void) fprintf(stdout, __VA_ARGS__); \
101 #define LOG_OPT(lvl, opt, ...) \
103 if (opt->rto_v >= lvl) \
104 (void) fprintf(stdout, __VA_ARGS__); \
107 #define ERR(...) (void) fprintf(stderr, __VA_ARGS__)
110 #define DBLSEP "================\n"
111 #define SEP "----------------\n"
114 #define raidz_alloc(size) abd_alloc(size, B_FALSE)
115 #define raidz_free(p, size) abd_free(p)
118 void init_zio_abd(zio_t
*zio
);
120 void run_raidz_benchmark(void);
122 #endif /* RAIDZ_TEST_H */