Lines Matching defs:spa

28 #include <sys/spa.h>
57 * maintained independently in spa.c. Whenever the namespace is modified, or
224 spa_t *spa = NULL;
232 while ((spa = spa_next(spa)) != NULL) {
235 * ourselves from the spa namespace or any pool that
240 if ((spa == target && removing) ||
241 !spa_writeable(spa))
244 mutex_enter(&spa->spa_props_lock);
245 tdp = list_head(&spa->spa_config_list);
246 if (spa->spa_config == NULL ||
249 mutex_exit(&spa->spa_props_lock);
256 fnvlist_add_nvlist(nvl, spa->spa_name,
257 spa->spa_config);
258 mutex_exit(&spa->spa_props_lock);
314 spa_t *spa = NULL;
322 while ((spa = spa_next(spa)) != NULL) {
324 zone_dataset_visible(spa_name(spa), NULL)) {
325 mutex_enter(&spa->spa_props_lock);
326 fnvlist_add_nvlist(pools, spa_name(spa),
327 spa->spa_config);
328 mutex_exit(&spa->spa_props_lock);
338 spa_config_set(spa_t *spa, nvlist_t *config)
340 mutex_enter(&spa->spa_props_lock);
341 nvlist_free(spa->spa_config);
342 spa->spa_config = config;
343 mutex_exit(&spa->spa_props_lock);
353 spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t txg, int getstats)
356 vdev_t *rvd = spa->spa_root_vdev;
364 spa_config_enter(spa, SCL_CONFIG | SCL_STATE, FTAG, RW_READER);
367 ASSERT(spa_config_held(spa, SCL_CONFIG | SCL_STATE, RW_READER) ==
371 * If txg is -1, report the current value of spa->spa_config_txg.
374 txg = spa->spa_config_txg;
378 fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, spa_version(spa));
379 fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, spa_name(spa));
380 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa));
382 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa));
383 if (spa->spa_comment != NULL) {
385 spa->spa_comment);
422 if (spa->spa_config_splitting != NULL)
424 spa->spa_config_splitting);
435 vdev_top_config_generate(spa, config);
440 if (spa->spa_config_splitting != NULL &&
441 nvlist_lookup_uint64(spa->spa_config_splitting,
447 nvroot = vdev_config_generate(spa, vd, getstats, config_gen_flags);
455 spa->spa_label_features);
457 if (getstats && spa_load_state(spa) == SPA_LOAD_NONE) {
463 ddt_get_dedup_histogram(spa, ddh);
470 ddt_get_dedup_object_stats(spa, ddo);
477 ddt_get_dedup_stats(spa, dds);
485 spa_config_exit(spa, SCL_CONFIG | SCL_STATE, FTAG);
496 spa_config_update(spa_t *spa, int what)
498 vdev_t *rvd = spa->spa_root_vdev;
504 spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
505 txg = spa_last_synced_txg(spa) + 1;
523 spa_config_exit(spa, SCL_ALL, FTAG);
528 txg_wait_synced(spa->spa_dsl_pool, txg);
533 if (!spa->spa_is_root)
534 spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL);
537 spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS);