* Determine if the vdev is readable at the given offset. */
| 1512 | * Determine if the vdev is readable at the given offset. |
| 1513 | */ |
| 1514 | boolean_t |
| 1515 | vdev_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. |
no test coverage detected