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

Function vdev_raidz_reconstruct_q

freebsd/contrib/openzfs/module/zfs/vdev_raidz.c:886–929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886static int
887vdev_raidz_reconstruct_q(raidz_row_t *rr, int *tgts, int ntgts)
888{
889 int x = tgts[0];
890 int c, exp;
891 abd_t *dst, *src;
892
893 ASSERT(ntgts == 1);
894
895 ASSERT(rr->rr_col[x].rc_size <= rr->rr_col[VDEV_RAIDZ_Q].rc_size);
896
897 for (c = rr->rr_firstdatacol; c < rr->rr_cols; c++) {
898 uint64_t size = (c == x) ? 0 : MIN(rr->rr_col[x].rc_size,
899 rr->rr_col[c].rc_size);
900
901 src = rr->rr_col[c].rc_abd;
902 dst = rr->rr_col[x].rc_abd;
903
904 if (c == rr->rr_firstdatacol) {
905 abd_copy(dst, src, size);
906 if (rr->rr_col[x].rc_size > size) {
907 abd_zero_off(dst, size,
908 rr->rr_col[x].rc_size - size);
909 }
910 } else {
911 ASSERT3U(size, <=, rr->rr_col[x].rc_size);
912 (void) abd_iterate_func2(dst, src, 0, 0, size,
913 vdev_raidz_reconst_q_pre_func, NULL);
914 (void) abd_iterate_func(dst,
915 size, rr->rr_col[x].rc_size - size,
916 vdev_raidz_reconst_q_pre_tail_func, NULL);
917 }
918 }
919
920 src = rr->rr_col[VDEV_RAIDZ_Q].rc_abd;
921 dst = rr->rr_col[x].rc_abd;
922 exp = 255 - (rr->rr_cols - 1 - x);
923
924 struct reconst_q_struct rq = { abd_to_buf(src), exp };
925 (void) abd_iterate_func(dst, 0, rr->rr_col[x].rc_size,
926 vdev_raidz_reconst_q_post_func, &rq);
927
928 return (1 << VDEV_RAIDZ_Q);
929}
930
931static int
932vdev_raidz_reconstruct_pq(raidz_row_t *rr, int *tgts, int ntgts)

Callers 1

Calls 5

abd_copyFunction · 0.85
abd_zero_offFunction · 0.85
abd_iterate_func2Function · 0.85
abd_iterate_funcFunction · 0.85
abd_to_bufFunction · 0.85

Tested by

no test coverage detected