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

Function ztest_import

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

* Import a storage pool with the given name. */

Source from the content-addressed store, hash-verified

7163 * Import a storage pool with the given name.
7164 */
7165static void
7166ztest_import(ztest_shared_t *zs)
7167{
7168 spa_t *spa;
7169
7170 mutex_init(&ztest_vdev_lock, NULL, MUTEX_DEFAULT, NULL);
7171 mutex_init(&ztest_checkpoint_lock, NULL, MUTEX_DEFAULT, NULL);
7172 VERIFY0(pthread_rwlock_init(&ztest_name_lock, NULL));
7173
7174 kernel_init(SPA_MODE_READ | SPA_MODE_WRITE);
7175
7176 ztest_import_impl(zs);
7177
7178 VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
7179 zs->zs_metaslab_sz =
7180 1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
7181 spa_close(spa, FTAG);
7182
7183 kernel_fini();
7184
7185 if (!ztest_opts.zo_mmp_test) {
7186 ztest_run_zdb(ztest_opts.zo_pool);
7187 ztest_freeze();
7188 ztest_run_zdb(ztest_opts.zo_pool);
7189 }
7190
7191 (void) pthread_rwlock_destroy(&ztest_name_lock);
7192 mutex_destroy(&ztest_vdev_lock);
7193 mutex_destroy(&ztest_checkpoint_lock);
7194}
7195
7196/*
7197 * Kick off threads to run tests on all datasets in parallel.

Callers 1

ztest_run_initFunction · 0.85

Calls 9

kernel_initFunction · 0.85
ztest_import_implFunction · 0.85
spa_openFunction · 0.85
spa_closeFunction · 0.85
kernel_finiFunction · 0.85
ztest_run_zdbFunction · 0.85
ztest_freezeFunction · 0.85
mutex_destroyFunction · 0.85
mutex_initFunction · 0.50

Tested by

no test coverage detected