ztest_random
ztest_random(SPA_VERSION_BEFORE_FEATURES - version + 1);
block_shift = ztest_random(maxbs - ztest_spa->spa_max_ashift + 1);
switch (ztest_random(10)) {
slots = 5 + ztest_random(max_slots - 4);
slots = 2 + ztest_random(3);
ztest_random(DN_MAX_INDBLKSHIFT - DN_MIN_INDBLKSHIFT + 1));
top = ztest_random(rvd->vdev_children);
value = zfs_prop_random_value(prop, ztest_random(-1ULL));
#define TXG_MIGHTWAIT (ztest_random(10) == 0 ? TXG_NOWAIT : TXG_WAIT)
itx_wr_state_t write_state = ztest_random(WR_NUM_STATES);
itx->itx_sync = (ztest_random(8) == 0);
if (ztest_random(8) == 0 && length == doi.doi_data_block_size &&
if (ztest_random(4) != 0) {
int prefetch = ztest_random(2) ?
lr->lr_size = (ztest_random(db->db_size / sizeof (*bbt)) + 1) *
io_type = ztest_random(ZTEST_IO_TYPES);
if (ztest_random(2) == 0)
if (ztest_random(2) == 0) {
zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
if (ztest_random(2) == 0) {
if (spa_has_slogs(spa) && ztest_random(4) == 0) {
ztest_opts.zo_vdev_size, 0, (ztest_random(4) == 0) ?
const char *class = (ztest_random(2) == 0) ?
ztest_random(2) == 0)) {
spa_special_class(spa)->mc_groups == 1 && ztest_random(2) == 0) {
if (ztest_random(2) == 0) {
if (sav->sav_count != 0 && ztest_random(4) == 0) {
guid = sav->sav_vdevs[ztest_random(sav->sav_count)]->vdev_guid;
if (ztest_random(2) == 0)
replacing = ztest_random(2);
leaf = ztest_random(leaves);
oldvd = oldvd->vdev_child[ztest_random(oldvd->vdev_children)];
if (oldvd_has_siblings && ztest_random(2) == 0) {
if (sav->sav_count != 0 && ztest_random(3) == 0) {
newvd = sav->sav_vdevs[ztest_random(sav->sav_count)];
if (ztest_random(2) == 0)
newsize = 10 * oldsize / (9 + ztest_random(3));
rand = ztest_random(2);
rand = ztest_random(ZIO_CRYPT_FUNCTIONS);
rand = ztest_random(100);
if (ztest_random(2) == 0 &&
iters = ztest_random(5);
if (ztest_random(iters) == 0)
while (ztest_random(4 * batchsize) != 0)
ztest_io(zd, od[ztest_random(batchsize)].od_object,
ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
object = ztest_random(os->os_obj_next_chunk);
uint64_t chunksize = (1000 + ztest_random(1000)) * sizeof (uint64_t);
n = ztest_random(regions) * stride + ztest_random(width);
s = 1 + ztest_random(2 * width - 1);
n = ztest_random(regions) * stride + ztest_random(width);
s = 1 + ztest_random(width - 1);
freeit = (ztest_random(100) < free_percent);
pack->bw_data = 1 + ztest_random(-2ULL);
pack->bw_data = 1 + ztest_random(-2ULL);
n = ztest_random(regions) * stride + ztest_random(width);
s = 1 + ztest_random(width - 1);
if (i != 0 || ztest_random(2) != 0) {
uint64_t offset = (1ULL << (ztest_random(20) + 43)) +
(ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
while (ztest_random(10) != 0)
uint64_t offset = (1ULL << (ztest_random(4) + SPA_MAXBLOCKSHIFT)) +
(ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
uint64_t count = ztest_random(20) + 1;
if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0)
while (ztest_random(count) != 0) {
uint64_t randoff = offset + (ztest_random(count) * blocksize);
while (ztest_random(4) != 0)
if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0)
prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0)
int micro = ztest_random(2);
namelen = ztest_random(sizeof (name) - 5) + 5 + 1;
name[i] = '!' + ztest_random('~' - '!' + 1);
i = ztest_random(5);
if (ztest_random(100) == 0)
ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
(void) ztest_spa_prop_set_uint64(ZPOOL_PROP_AUTOTRIM, ztest_random(2));
*ptr = ztest_random(UINT_MAX);
*ptr = ztest_random(UINT_MAX);
size_t inc = 64 * ztest_random(size / 67);
if (ztest_random(100) < 10)
inc += P2ALIGN(ztest_random(64),
if (ztest_random(2) == 0) {
leaf = ztest_random(leaves) + zs->zs_splits;
if (vf != NULL && ztest_random(3) == 0) {
} else if (ztest_random(2) == 0) {
vd0 = sav->sav_vdevs[ztest_random(sav->sav_count)];
if (ztest_random(10) < 6) {
int flags = (ztest_random(2) == 0 ?
offset = ztest_random(fsize / (leaves << bshift)) *
(ztest_random(1ULL << (bshift - 1)) & -8ULL);
uint64_t child_no = ztest_random(eligible_idx);
uint64_t cmd = ztest_random(POOL_INITIALIZE_FUNCS);
uint64_t cmd = ztest_random(POOL_TRIM_FUNCS);
uint64_t rate = 1 << ztest_random(30);
boolean_t partial = (ztest_random(5) > 0);
boolean_t secure = (ztest_random(5) > 0);
if (ztest_random(2) == 0)
if (ztest_random(10) == 0)
zfs_compressed_arc_enabled = ztest_random(2);
if (ztest_random(10) == 0)
zfs_abd_scatter_enabled = ztest_random(2);
rand = ztest_random(ZTEST_FUNCS);
ztest_random(2 * zi->zi_interval[0] + 1)) == call_next) {
if (ztest_random(100) < ztest_opts.zo_killrate) {
ztest_random(ztest_opts.zo_passtime * NANOSEC);
metaslab_preload_limit = ztest_random(20) + 1;
int d = ztest_random(ztest_opts.zo_datasets);
if ((ztest_random(2) == 0) && !ztest_opts.zo_mmp_test) {
while (ztest_random(10) != 0 &&
ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
if (ztest_random(2) == 0)
if (i == SPA_FEATURE_LOG_SPACEMAP && ztest_random(4) == 0)
ztest_random(2 * zi->zi_interval[0] + 1);
ztest_random(zs->zs_metaslab_sz / 4) + 1;
if (!hasalt || ztest_random(2) == 0) {
return (SPA_MINBLOCKSHIFT + ztest_random(5));