* Lookup the permutation array and iteration id for the provided offset. */
| 555 | * Lookup the permutation array and iteration id for the provided offset. |
| 556 | */ |
| 557 | static void |
| 558 | vdev_draid_get_perm(vdev_draid_config_t *vdc, uint64_t pindex, |
| 559 | uint8_t **base, uint64_t *iter) |
| 560 | { |
| 561 | uint64_t ncols = vdc->vdc_children; |
| 562 | uint64_t poff = pindex % (vdc->vdc_nperms * ncols); |
| 563 | |
| 564 | *base = vdc->vdc_perms + (poff / ncols) * ncols; |
| 565 | *iter = poff % ncols; |
| 566 | } |
| 567 | |
| 568 | static inline uint64_t |
| 569 | vdev_draid_permute_id(vdev_draid_config_t *vdc, |
no outgoing calls
no test coverage detected