Lines Matching defs:config

148 static int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
313 * Get properties from the spa config.
485 * Make sure the vdev config is bootable
1634 * Validate the current config against the MOS config
1637 spa_config_valid(spa_t *spa, nvlist_t *config)
1642 VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nv) == 0);
1651 * diagnostic information about missing devices in this config.
1688 * from the MOS config (mrvd). Check each top-level vdev
1689 * with the corresponding MOS config top-level (mtvd).
1697 * If we find that the MOS config has more accurate information
1723 * able to obtain from the MOS config.
1740 * config since it's possible that the label
1759 * Ensure we were able to validate the config.
2038 * Fix up config after a partly-completed split. This is done with the
2040 * pool have that entry in their config, but only the splitting one contains
2050 * Otherwise we leave the config alone, with all the vdevs in place in
2054 spa_try_repair(spa_t *spa, nvlist_t *config)
2063 if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_SPLIT, &nvl) != 0)
2066 /* check that the config is complete */
2123 nvlist_t *config = spa->spa_config;
2130 if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID, &pool_guid))
2134 if (nvlist_lookup_string(config, ZPOOL_CONFIG_COMMENT, &comment) == 0)
2141 if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
2145 (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG,
2154 if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_SPLIT,
2164 error = spa_load_impl(spa, pool_guid, config, state, type,
2222 spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
2238 * If this is an untrusted config, access the pool in read-only mode.
2248 if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvroot))
2298 * that config. Otherwise, we're validating against the cached config
2301 * the vdev config.
2398 * is aware of the complete config (i.e ZPOOL_CONFIG_VDEV_CHILDREN).
2402 if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN,
2409 spa_try_repair(spa, config);
2652 /* The sentinel is only available in the MOS config. */
2755 * the MOS config, not necessarily from the userland config.
2785 * Validate the config, using the MOS config to fill in any
2787 * the config then declare the pool unfit for use. If we're
2805 * Now that we've validated the config, check the state of the
2877 * If the config cache is stale, or we have uninitialized
2878 * metaslabs (see spa_vdev_add()), then update the config.
2894 * Update the config cache asychronously in case we're the
2895 * root pool, in which case the config cache isn't writable yet.
2956 nvlist_t *config = NULL;
2976 config = spa_config_generate(spa, NULL, -1ULL, B_TRUE);
2982 nvlist_free(config);
3018 if (config && (rewind_error || state != SPA_LOAD_RECOVER))
3019 spa_config_set(spa, config);
3051 nvlist_t **config)
3098 * this is the case, the config cache is out of sync and
3116 if (config != NULL && spa->spa_config) {
3117 VERIFY(nvlist_dup(spa->spa_config, config,
3119 VERIFY(nvlist_add_nvlist(*config,
3135 if (config != NULL)
3136 *config = spa_config_generate(spa, NULL, -1ULL, B_TRUE);
3143 VERIFY(nvlist_add_nvlist(*config, ZPOOL_CONFIG_LOAD_INFO,
3161 nvlist_t **config)
3163 return (spa_open_common(name, spapp, tag, policy, config));
3204 spa_add_spares(spa_t *spa, nvlist_t *config)
3219 VERIFY(nvlist_lookup_nvlist(config,
3253 spa_add_l2cache(spa_t *spa, nvlist_t *config)
3268 VERIFY(nvlist_lookup_nvlist(config,
3305 spa_add_feature_stats(spa_t *spa, nvlist_t *config)
3340 VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
3346 spa_get_stats(const char *name, nvlist_t **config,
3352 *config = NULL;
3353 error = spa_open_common(name, &spa, FTAG, NULL, config);
3358 * or l2cache devices could change and the config would be
3363 if (*config != NULL) {
3368 VERIFY(nvlist_add_uint64_array(*config,
3371 VERIFY(nvlist_add_uint64(*config,
3376 VERIFY(nvlist_add_uint64(*config,
3380 spa_add_spares(spa, *config);
3381 spa_add_l2cache(spa, *config);
3382 spa_add_feature_stats(spa, *config);
3421 spa_aux_vdev_t *sav, const char *config, uint64_t version,
3434 if (nvlist_lookup_nvlist_array(nvroot, config, &dev, &ndev) != 0)
3470 if ((strcmp(config, ZPOOL_CONFIG_L2CACHE) == 0) &&
3520 const char *config)
3533 VERIFY(nvlist_lookup_nvlist_array(sav->sav_config, config,
3545 VERIFY(nvlist_remove(sav->sav_config, config,
3549 config, newdevs, ndevs + oldndevs) == 0);
3559 VERIFY(nvlist_add_nvlist_array(sav->sav_config, config,
3737 * Create the pool config object.
3746 cmn_err(CE_PANIC, "failed to add pool config");
3848 nvlist_t *config;
3852 if (vdev_disk_read_rootlabel(devpath, devid, &config) != 0)
3858 VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
3860 VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
3862 VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, guid) == 0);
3879 VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, nvroot) == 0);
3881 return (config);
3934 nvlist_t *config, *nvtop;
3942 config = spa_generate_rootconf(devpath, devid, &guid);
3944 if (config == NULL) {
3948 config = spa_generate_rootconf(devpath, devid, &guid);
3952 if (config == NULL) {
3958 VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
3960 VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0);
3966 * can replace it with the correct config we just read in.
3971 spa = spa_add(pname, config, NULL);
3976 * Build up a vdev tree based on the boot device's label config.
3978 VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
3986 nvlist_free(config);
3987 cmn_err(CE_NOTE, "Can not parse the config for pool '%s'",
4035 nvlist_free(config);
4045 spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
4076 spa = spa_add(pool, config, altroot);
4101 zpool_get_rewind_policy(config, &policy);
4107 * because the user-supplied config is actually the one to trust when
4120 VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
4139 VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
4208 * Update the config cache to include the newly-imported pool.
4231 nvlist_t *config = NULL;
4252 * Pass TRUE for mosconfig because the user-supplied config
4258 * If 'tryconfig' was at least parsable, return the current config.
4261 config = spa_config_generate(spa, NULL, -1ULL, B_TRUE);
4262 VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME,
4264 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
4266 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_TIMESTAMP,
4268 VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
4296 VERIFY(nvlist_add_string(config,
4307 spa_add_spares(spa, config);
4308 spa_add_l2cache(spa, config);
4317 return (config);
4551 * sync the config cache, and we lose power, then upon reboot we may
4552 * fail to open the pool because there are DVAs that the config cache
4554 * initializing metaslabs; sync the config cache (via spa_vdev_exit());
4766 * Commit the config
5026 spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
5062 if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nvl) != 0 ||
5178 * Temporarily record the splitting vdevs in the spa config. This
5179 * will disappear once the config is regenerated.
5194 VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, newname) == 0);
5195 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
5197 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
5199 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG,
5201 VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID,
5203 VERIFY0(nvlist_add_boolean(config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS));
5208 newspa = spa_add(newname, config, altroot);
5213 /* release the spa config lock, retaining the namespace lock */
5227 /* if that worked, generate a real config for the new pool */
5255 /* finally, update the original pool's config */
5334 spa_vdev_remove_aux(nvlist_t *config, char *name, nvlist_t **dev, int count,
5348 VERIFY(nvlist_remove(config, name, DATA_TYPE_NVLIST_ARRAY) == 0);
5349 VERIFY(nvlist_add_nvlist_array(config, name, newdev, count - 1) == 0);
5372 * Evacuate the device. We don't hold the config lock as writer
5859 * See if the config needs to be updated.
5871 * If the pool grew as a result of the config update,
6076 const char *config, const char *entry)
6101 VERIFY(nvlist_add_nvlist_array(nvroot, config, NULL, 0) == 0);
6107 VERIFY(nvlist_add_nvlist_array(nvroot, config, list,
6144 nvlist_t *config;
6148 * its config may not be dirty but we still need to build per-vdev ZAPs.
6150 * need to rebuild the AVZ although the config may not be dirty.
6232 config = spa_config_generate(spa, spa->spa_root_vdev,
6237 * the config object gets updated with the correct version.
6240 fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
6246 spa->spa_config_syncing = config;
6248 spa_sync_nvlist(spa, spa->spa_config_object, config, tx);
6523 * into config changes that go out with this transaction group.
6674 * called if the config is dirty; otherwise there may be
6691 * config cache (see spa_vdev_add() for a complete description).
6736 * Clear the dirty config list.
6742 * Now that the new config has synced transactionally,
6743 * let it become visible to the config cache.