* 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. */
| 1841 | * on metaslab boundaries which vdev_xlate() expects to be aligned. |
| 1842 | */ |
| 1843 | static void |
| 1844 | vdev_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 |
nothing calls this directly
no test coverage detected