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

Function vdev_set_deflate_ratio

freebsd/contrib/openzfs/module/zfs/vdev.c:1730–1737  ·  view source on GitHub ↗

* Compute the raidz-deflation ratio. Note, we hard-code * in 128k (1 << 17) because it is the "typical" blocksize. * Even though SPA_MAXBLOCKSIZE changed, this algorithm can not change, * otherwise it would inconsistently account for existing bp's. */

Source from the content-addressed store, hash-verified

1728 * otherwise it would inconsistently account for existing bp's.
1729 */
1730static void
1731vdev_set_deflate_ratio(vdev_t *vd)
1732{
1733 if (vd == vd->vdev_top && !vd->vdev_ishole && vd->vdev_ashift != 0) {
1734 vd->vdev_deflate_ratio = (1 << 17) /
1735 (vdev_psize_to_asize(vd, 1 << 17) >> SPA_MINBLOCKSHIFT);
1736 }
1737}
1738
1739/*
1740 * Maximize performance by inflating the configured ashift for top level

Callers 2

vdev_loadFunction · 0.85
vdev_expandFunction · 0.85

Calls 1

vdev_psize_to_asizeFunction · 0.85

Tested by

no test coverage detected