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

Function ztest_dmu_write_parallel

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

ARGSUSED */

Source from the content-addressed store, hash-verified

5047
5048/* ARGSUSED */
5049void
5050ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id)
5051{
5052 ztest_od_t *od;
5053
5054 od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
5055 uint64_t offset = (1ULL << (ztest_random(20) + 43)) +
5056 (ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
5057
5058 /*
5059 * Have multiple threads write to large offsets in an object
5060 * to verify that parallel writes to an object -- even to the
5061 * same blocks within the object -- doesn't cause any trouble.
5062 */
5063 ztest_od_init(od, ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0);
5064
5065 if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0)
5066 return;
5067
5068 while (ztest_random(10) != 0)
5069 ztest_io(zd, od->od_object, offset);
5070
5071 umem_free(od, sizeof (ztest_od_t));
5072}
5073
5074void
5075ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id)

Callers

nothing calls this directly

Calls 6

umem_allocFunction · 0.85
ztest_randomFunction · 0.85
ztest_od_initFunction · 0.85
ztest_object_initFunction · 0.85
ztest_ioFunction · 0.85
umem_freeFunction · 0.85

Tested by

no test coverage detected