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

Function ztest_object_init

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

* Lookup or create the objects for a test using the od template. * If the objects do not all exist, or if 'remove' is specified, * remove any existing objects and create new ones. Otherwise, * use the existing objects. */

Source from the content-addressed store, hash-verified

2718 * use the existing objects.
2719 */
2720static int
2721ztest_object_init(ztest_ds_t *zd, ztest_od_t *od, size_t size, boolean_t remove)
2722{
2723 int count = size / sizeof (*od);
2724 int rv = 0;
2725
2726 mutex_enter(&zd->zd_dirobj_lock);
2727 if ((ztest_lookup(zd, od, count) != 0 || remove) &&
2728 (ztest_remove(zd, od, count) != 0 ||
2729 ztest_create(zd, od, count) != 0))
2730 rv = -1;
2731 zd->zd_od = od;
2732 mutex_exit(&zd->zd_dirobj_lock);
2733
2734 return (rv);
2735}
2736
2737/* ARGSUSED */
2738void

Callers 10

ztest_dmu_read_writeFunction · 0.85
ztest_dmu_write_parallelFunction · 0.85
ztest_dmu_preallocFunction · 0.85
ztest_zapFunction · 0.85
ztest_fzapFunction · 0.85
ztest_zap_parallelFunction · 0.85
ztest_freezeFunction · 0.85

Calls 5

mutex_enterFunction · 0.85
ztest_lookupFunction · 0.85
ztest_removeFunction · 0.85
ztest_createFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected