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

Function init_raidz_map

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

Source from the content-addressed store, hash-verified

541}
542
543static raidz_map_t *
544init_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
578static int
579run_gen_check(raidz_test_opts_t *opts)

Callers 2

run_gen_checkFunction · 0.85
run_rec_checkFunction · 0.85

Calls 5

umem_zallocFunction · 0.85
init_zio_abdFunction · 0.85
vdev_raidz_map_allocFunction · 0.85
corrupt_columsFunction · 0.85

Tested by

no test coverage detected