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

Function vdev_draid_metaslab_init

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

* Align the start of the metaslab to the group width and slightly reduce * its size to a multiple of the group width. Since full stripe writes are * required by dRAID this space is unallocable. Furthermore, aligning the * metaslab start is important for vdev initialize and TRIM which both operate * on metaslab boundaries which vdev_xlate() expects to be aligned. */

Source from the content-addressed store, hash-verified

1841 * on metaslab boundaries which vdev_xlate() expects to be aligned.
1842 */
1843static void
1844vdev_draid_metaslab_init(vdev_t *vd, uint64_t *ms_start, uint64_t *ms_size)
1845{
1846 vdev_draid_config_t *vdc = vd->vdev_tsd;
1847
1848 ASSERT3P(vd->vdev_ops, ==, &vdev_draid_ops);
1849
1850 uint64_t sz = vdc->vdc_groupwidth << vd->vdev_ashift;
1851 uint64_t astart = vdev_draid_get_astart(vd, *ms_start);
1852 uint64_t asize = ((*ms_size - (astart - *ms_start)) / sz) * sz;
1853
1854 *ms_start = astart;
1855 *ms_size = asize;
1856
1857 ASSERT0(*ms_start % sz);
1858 ASSERT0(*ms_size % sz);
1859}
1860
1861/*
1862 * Add virtual dRAID spares to the list of valid spares. In order to accomplish

Callers

nothing calls this directly

Calls 1

vdev_draid_get_astartFunction · 0.85

Tested by

no test coverage detected