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

Function vdev_draid_asize

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

* Return the asize which is the psize rounded up to a full group width. * i.e. vdev_draid_psize_to_asize(). */

Source from the content-addressed store, hash-verified

577 * i.e. vdev_draid_psize_to_asize().
578 */
579static uint64_t
580vdev_draid_asize(vdev_t *vd, uint64_t psize)
581{
582 vdev_draid_config_t *vdc = vd->vdev_tsd;
583 uint64_t ashift = vd->vdev_ashift;
584
585 ASSERT3P(vd->vdev_ops, ==, &vdev_draid_ops);
586
587 uint64_t rows = ((psize - 1) / (vdc->vdc_ndata << ashift)) + 1;
588 uint64_t asize = (rows * vdc->vdc_groupwidth) << ashift;
589
590 ASSERT3U(asize, !=, 0);
591 ASSERT3U(asize % (vdc->vdc_groupwidth), ==, 0);
592
593 return (asize);
594}
595
596/*
597 * Deflate the asize to the psize, this includes stripping parity.

Callers 4

vdev_draid_map_alloc_rowFunction · 0.70
vdev_draid_map_allocFunction · 0.70
vdev_draid_need_resilverFunction · 0.70
vdev_draid_io_verifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected