* Import a storage pool with the given name. */
| 7163 | * Import a storage pool with the given name. |
| 7164 | */ |
| 7165 | static void |
| 7166 | ztest_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. |
no test coverage detected