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

Function ztest_random_blocksize

freebsd/contrib/openzfs/cmd/ztest/ztest.c:1276–1291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276static int
1277ztest_random_blocksize(void)
1278{
1279 ASSERT(ztest_spa->spa_max_ashift != 0);
1280
1281 /*
1282 * Choose a block size >= the ashift.
1283 * If the SPA supports new MAXBLOCKSIZE, test up to 1MB blocks.
1284 */
1285 int maxbs = SPA_OLD_MAXBLOCKSHIFT;
1286 if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE)
1287 maxbs = 20;
1288 uint64_t block_shift =
1289 ztest_random(maxbs - ztest_spa->spa_max_ashift + 1);
1290 return (1 << (SPA_MINBLOCKSHIFT + block_shift));
1291}
1292
1293static int
1294ztest_random_dnodesize(void)

Callers 6

ztest_od_initFunction · 0.85
ztest_dmu_preallocFunction · 0.85
ztest_dsl_prop_get_setFunction · 0.85
ztest_fletcherFunction · 0.85
ztest_fletcher_incrFunction · 0.85

Calls 2

spa_maxblocksizeFunction · 0.85
ztest_randomFunction · 0.85

Tested by

no test coverage detected