5989 nvlist_t *config;
5990
5991 if (list_is_empty(&spa->spa_config_dirty_list))
5992 return;
5993
5994 spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
5995
5996 config = spa_config_generate(spa, spa->spa_root_vdev,
5997 dmu_tx_get_txg(tx), B_FALSE);
5998
5999 /*
6000 * If we're upgrading the spa version then make sure that
6001 * the config object gets updated with the correct version.
6002 */
6003 if (spa->spa_ubsync.ub_version < spa->spa_uberblock.ub_version)
6004 fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
6005 spa->spa_uberblock.ub_version);
6006
6007 spa_config_exit(spa, SCL_STATE, FTAG);
6008
6009 if (spa->spa_config_syncing)
6010 nvlist_free(spa->spa_config_syncing);
6011 spa->spa_config_syncing = config;
6012
6013 spa_sync_nvlist(spa, spa->spa_config_object, config, tx);
6014 }
6015
6016 static void
6017 spa_sync_version(void *arg, dmu_tx_t *tx)
6018 {
6019 uint64_t *versionp = arg;
6020 uint64_t version = *versionp;
6021 spa_t *spa = dmu_tx_pool(tx)->dp_spa;
6022
6023 /*
6024 * Setting the version is special cased when first creating the pool.
6025 */
6026 ASSERT(tx->tx_txg != TXG_INITIAL);
6027
6028 ASSERT(SPA_VERSION_IS_SUPPORTED(version));
6029 ASSERT(version >= spa_version(spa));
|
5989 nvlist_t *config;
5990
5991 if (list_is_empty(&spa->spa_config_dirty_list))
5992 return;
5993
5994 spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
5995
5996 config = spa_config_generate(spa, spa->spa_root_vdev,
5997 dmu_tx_get_txg(tx), B_FALSE);
5998
5999 /*
6000 * If we're upgrading the spa version then make sure that
6001 * the config object gets updated with the correct version.
6002 */
6003 if (spa->spa_ubsync.ub_version < spa->spa_uberblock.ub_version)
6004 fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
6005 spa->spa_uberblock.ub_version);
6006
6007 spa_config_exit(spa, SCL_STATE, FTAG);
6008
6009 nvlist_free(spa->spa_config_syncing);
6010 spa->spa_config_syncing = config;
6011
6012 spa_sync_nvlist(spa, spa->spa_config_object, config, tx);
6013 }
6014
6015 static void
6016 spa_sync_version(void *arg, dmu_tx_t *tx)
6017 {
6018 uint64_t *versionp = arg;
6019 uint64_t version = *versionp;
6020 spa_t *spa = dmu_tx_pool(tx)->dp_spa;
6021
6022 /*
6023 * Setting the version is special cased when first creating the pool.
6024 */
6025 ASSERT(tx->tx_txg != TXG_INITIAL);
6026
6027 ASSERT(SPA_VERSION_IS_SUPPORTED(version));
6028 ASSERT(version >= spa_version(spa));
|