Print this page
patch tsoome-feedback


 327         mutex_enter(&spa_namespace_lock);
 328         while ((spa = spa_next(spa)) != NULL) {
 329                 if (INGLOBALZONE(curproc) ||
 330                     zone_dataset_visible(spa_name(spa), NULL)) {
 331                         mutex_enter(&spa->spa_props_lock);
 332                         VERIFY(nvlist_add_nvlist(pools, spa_name(spa),
 333                             spa->spa_config) == 0);
 334                         mutex_exit(&spa->spa_props_lock);
 335                 }
 336         }
 337         *generation = spa_config_generation;
 338         mutex_exit(&spa_namespace_lock);
 339 
 340         return (pools);
 341 }
 342 
 343 void
 344 spa_config_set(spa_t *spa, nvlist_t *config)
 345 {
 346         mutex_enter(&spa->spa_props_lock);
 347         if (spa->spa_config != NULL)
 348                 nvlist_free(spa->spa_config);
 349         spa->spa_config = config;
 350         mutex_exit(&spa->spa_props_lock);
 351 }
 352 
 353 /*
 354  * Generate the pool's configuration based on the current in-core state.
 355  *
 356  * We infer whether to generate a complete config or just one top-level config
 357  * based on whether vd is the root vdev.
 358  */
 359 nvlist_t *
 360 spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t txg, int getstats)
 361 {
 362         nvlist_t *config, *nvroot;
 363         vdev_t *rvd = spa->spa_root_vdev;
 364         unsigned long hostid = 0;
 365         boolean_t locked = B_FALSE;
 366         uint64_t split_guid;
 367 




 327         mutex_enter(&spa_namespace_lock);
 328         while ((spa = spa_next(spa)) != NULL) {
 329                 if (INGLOBALZONE(curproc) ||
 330                     zone_dataset_visible(spa_name(spa), NULL)) {
 331                         mutex_enter(&spa->spa_props_lock);
 332                         VERIFY(nvlist_add_nvlist(pools, spa_name(spa),
 333                             spa->spa_config) == 0);
 334                         mutex_exit(&spa->spa_props_lock);
 335                 }
 336         }
 337         *generation = spa_config_generation;
 338         mutex_exit(&spa_namespace_lock);
 339 
 340         return (pools);
 341 }
 342 
 343 void
 344 spa_config_set(spa_t *spa, nvlist_t *config)
 345 {
 346         mutex_enter(&spa->spa_props_lock);

 347         nvlist_free(spa->spa_config);
 348         spa->spa_config = config;
 349         mutex_exit(&spa->spa_props_lock);
 350 }
 351 
 352 /*
 353  * Generate the pool's configuration based on the current in-core state.
 354  *
 355  * We infer whether to generate a complete config or just one top-level config
 356  * based on whether vd is the root vdev.
 357  */
 358 nvlist_t *
 359 spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t txg, int getstats)
 360 {
 361         nvlist_t *config, *nvroot;
 362         vdev_t *rvd = spa->spa_root_vdev;
 363         unsigned long hostid = 0;
 364         boolean_t locked = B_FALSE;
 365         uint64_t split_guid;
 366