MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmp_code

Function cmp_code

freebsd/contrib/openzfs/cmd/raidz_test/raidz_test.c:202–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200#define CODE_COL_SIZE(rr, i) ((rr)->rr_col[(i)].rc_size)
201
202static int
203cmp_code(raidz_test_opts_t *opts, const raidz_map_t *rm, const int parity)
204{
205 int r, i, ret = 0;
206
207 VERIFY(parity >= 1 && parity <= 3);
208
209 for (r = 0; r < rm->rm_nrows; r++) {
210 raidz_row_t * const rr = rm->rm_row[r];
211 raidz_row_t * const rrg = opts->rm_golden->rm_row[r];
212 for (i = 0; i < parity; i++) {
213 if (CODE_COL_SIZE(rrg, i) == 0) {
214 VERIFY0(CODE_COL_SIZE(rr, i));
215 continue;
216 }
217
218 if (abd_cmp(CODE_COL(rr, i),
219 CODE_COL(rrg, i)) != 0) {
220 ret++;
221 LOG_OPT(D_DEBUG, opts,
222 "\nParity block [%d] different!\n", i);
223 }
224 }
225 }
226 return (ret);
227}
228
229static int
230cmp_data(raidz_test_opts_t *opts, raidz_map_t *rm)

Callers 2

init_raidz_golden_mapFunction · 0.85
run_gen_checkFunction · 0.85

Calls 1

abd_cmpFunction · 0.85

Tested by

no test coverage detected