* Basic routines to read and write from a vdev label. * Used throughout the rest of this file. */
| 158 | * Used throughout the rest of this file. |
| 159 | */ |
| 160 | uint64_t |
| 161 | vdev_label_offset(uint64_t psize, int l, uint64_t offset) |
| 162 | { |
| 163 | ASSERT(offset < sizeof (vdev_label_t)); |
| 164 | ASSERT(P2PHASE_TYPED(psize, sizeof (vdev_label_t), uint64_t) == 0); |
| 165 | |
| 166 | return (offset + l * sizeof (vdev_label_t) + (l < VDEV_LABELS / 2 ? |
| 167 | 0 : psize - VDEV_LABELS * sizeof (vdev_label_t))); |
| 168 | } |
| 169 | |
| 170 | /* |
| 171 | * Returns back the vdev label associated with the passed in offset. |
no outgoing calls
no test coverage detected