| 541 | } |
| 542 | |
| 543 | static raidz_map_t * |
| 544 | init_raidz_map(raidz_test_opts_t *opts, zio_t **zio, const int parity) |
| 545 | { |
| 546 | raidz_map_t *rm = NULL; |
| 547 | const size_t alloc_dsize = opts->rto_dsize; |
| 548 | const size_t total_ncols = opts->rto_dcols + parity; |
| 549 | const int ccols[] = { 0, 1, 2 }; |
| 550 | |
| 551 | VERIFY(zio); |
| 552 | VERIFY(parity <= 3 && parity >= 1); |
| 553 | |
| 554 | *zio = umem_zalloc(sizeof (zio_t), UMEM_NOFAIL); |
| 555 | |
| 556 | (*zio)->io_offset = 0; |
| 557 | (*zio)->io_size = alloc_dsize; |
| 558 | (*zio)->io_abd = raidz_alloc(alloc_dsize); |
| 559 | init_zio_abd(*zio); |
| 560 | |
| 561 | if (opts->rto_expand) { |
| 562 | rm = vdev_raidz_map_alloc_expanded((*zio)->io_abd, |
| 563 | (*zio)->io_size, (*zio)->io_offset, |
| 564 | opts->rto_ashift, total_ncols+1, total_ncols, |
| 565 | parity, opts->rto_expand_offset); |
| 566 | } else { |
| 567 | rm = vdev_raidz_map_alloc(*zio, opts->rto_ashift, |
| 568 | total_ncols, parity); |
| 569 | } |
| 570 | VERIFY(rm); |
| 571 | |
| 572 | /* Make sure code columns are destroyed */ |
| 573 | corrupt_colums(rm, ccols, parity); |
| 574 | |
| 575 | return (rm); |
| 576 | } |
| 577 | |
| 578 | static int |
| 579 | run_gen_check(raidz_test_opts_t *opts) |
no test coverage detected