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

Function vdev_draid_readable

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

* Determine if the vdev is readable at the given offset. */

Source from the content-addressed store, hash-verified

1512 * Determine if the vdev is readable at the given offset.
1513 */
1514boolean_t
1515vdev_draid_readable(vdev_t *vd, uint64_t physical_offset)
1516{
1517 if (vd->vdev_ops == &vdev_draid_spare_ops) {
1518 vd = vdev_draid_spare_get_child(vd, physical_offset);
1519 if (vd == NULL)
1520 return (B_FALSE);
1521 }
1522
1523 if (vd->vdev_ops == &vdev_spare_ops ||
1524 vd->vdev_ops == &vdev_replacing_ops) {
1525
1526 for (int c = 0; c < vd->vdev_children; c++) {
1527 vdev_t *cvd = vd->vdev_child[c];
1528
1529 if (!vdev_readable(cvd))
1530 continue;
1531
1532 if (vdev_draid_readable(cvd, physical_offset))
1533 return (B_TRUE);
1534 }
1535
1536 return (B_FALSE);
1537 }
1538
1539 return (vdev_readable(vd));
1540}
1541
1542/*
1543 * Returns the first distributed spare found under the provided vdev tree.

Callers 2

vdev_draid_io_start_readFunction · 0.85

Calls 2

vdev_readableFunction · 0.85

Tested by

no test coverage detected