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

Function vdev_draid_group_missing

freebsd/contrib/openzfs/module/zfs/vdev_draid.c:1627–1662  ·  view source on GitHub ↗

* Determine if the txg is missing. Used by healing resilver. */

Source from the content-addressed store, hash-verified

1625 * Determine if the txg is missing. Used by healing resilver.
1626 */
1627static boolean_t
1628vdev_draid_group_missing(vdev_t *vd, uint64_t offset, uint64_t txg,
1629 uint64_t size)
1630{
1631 vdev_draid_config_t *vdc = vd->vdev_tsd;
1632
1633 ASSERT3P(vd->vdev_ops, ==, &vdev_draid_ops);
1634 ASSERT3U(vdev_draid_get_astart(vd, offset), ==, offset);
1635
1636 uint64_t groupstart, perm;
1637 uint64_t physical_offset = vdev_draid_logical_to_physical(vd,
1638 offset, &perm, &groupstart);
1639
1640 uint8_t *base;
1641 uint64_t iter;
1642 vdev_draid_get_perm(vdc, perm, &base, &iter);
1643
1644 for (uint64_t i = 0; i < vdc->vdc_groupwidth; i++) {
1645 uint64_t c = (groupstart + i) % vdc->vdc_ndisks;
1646 uint64_t cid = vdev_draid_permute_id(vdc, base, iter, c);
1647 vdev_t *cvd = vd->vdev_child[cid];
1648
1649 /* Transaction group is known to be partially replicated. */
1650 if (vdev_draid_partial(cvd, physical_offset, txg, size))
1651 return (B_TRUE);
1652
1653 /*
1654 * Always check groups with active distributed spares
1655 * because any vdev failure in the pool will affect them.
1656 */
1657 if (vdev_draid_find_spare(cvd) != NULL)
1658 return (B_TRUE);
1659 }
1660
1661 return (B_FALSE);
1662}
1663
1664/*
1665 * Find the smallest child asize and largest sector size to calculate the

Callers 1

vdev_draid_need_resilverFunction · 0.85

Calls 6

vdev_draid_get_astartFunction · 0.85
vdev_draid_get_permFunction · 0.85
vdev_draid_permute_idFunction · 0.85
vdev_draid_partialFunction · 0.85
vdev_draid_find_spareFunction · 0.85

Tested by

no test coverage detected