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

Function vdev_label_offset

freebsd/contrib/openzfs/module/zfs/vdev_label.c:160–168  ·  view source on GitHub ↗

* Basic routines to read and write from a vdev label. * Used throughout the rest of this file. */

Source from the content-addressed store, hash-verified

158 * Used throughout the rest of this file.
159 */
160uint64_t
161vdev_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.

Callers 6

vdev_geom_read_configFunction · 0.85
vdev_probeFunction · 0.85
vdev_label_readFunction · 0.85
vdev_label_writeFunction · 0.85
dump_labelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected