spa.c: Replace VERIFY(nvlist_*(...) == 0) with fnvlist_* (#12678)
The fnvlist versions of the functions are fatal if they fail, saving each call from having to include checking the result. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Signed-off-by: Allan Jude <allan@klarasystems.com>
This commit is contained in:
parent
415882d228
commit
72a4709a59
285
module/zfs/spa.c
285
module/zfs/spa.c
|
@ -283,15 +283,15 @@ spa_prop_add_list(nvlist_t *nvl, zpool_prop_t prop, char *strval,
|
||||||
const char *propname = zpool_prop_to_name(prop);
|
const char *propname = zpool_prop_to_name(prop);
|
||||||
nvlist_t *propval;
|
nvlist_t *propval;
|
||||||
|
|
||||||
VERIFY(nvlist_alloc(&propval, NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
propval = fnvlist_alloc();
|
||||||
VERIFY(nvlist_add_uint64(propval, ZPROP_SOURCE, src) == 0);
|
fnvlist_add_uint64(propval, ZPROP_SOURCE, src);
|
||||||
|
|
||||||
if (strval != NULL)
|
if (strval != NULL)
|
||||||
VERIFY(nvlist_add_string(propval, ZPROP_VALUE, strval) == 0);
|
fnvlist_add_string(propval, ZPROP_VALUE, strval);
|
||||||
else
|
else
|
||||||
VERIFY(nvlist_add_uint64(propval, ZPROP_VALUE, intval) == 0);
|
fnvlist_add_uint64(propval, ZPROP_VALUE, intval);
|
||||||
|
|
||||||
VERIFY(nvlist_add_nvlist(nvl, propname, propval) == 0);
|
fnvlist_add_nvlist(nvl, propname, propval);
|
||||||
nvlist_free(propval);
|
nvlist_free(propval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1787,8 +1787,8 @@ spa_load_spares(spa_t *spa)
|
||||||
if (spa->spa_spares.sav_config == NULL)
|
if (spa->spa_spares.sav_config == NULL)
|
||||||
nspares = 0;
|
nspares = 0;
|
||||||
else
|
else
|
||||||
VERIFY(nvlist_lookup_nvlist_array(spa->spa_spares.sav_config,
|
VERIFY0(nvlist_lookup_nvlist_array(spa->spa_spares.sav_config,
|
||||||
ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0);
|
ZPOOL_CONFIG_SPARES, &spares, &nspares));
|
||||||
|
|
||||||
spa->spa_spares.sav_count = (int)nspares;
|
spa->spa_spares.sav_count = (int)nspares;
|
||||||
spa->spa_spares.sav_vdevs = NULL;
|
spa->spa_spares.sav_vdevs = NULL;
|
||||||
|
@ -1850,16 +1850,15 @@ spa_load_spares(spa_t *spa)
|
||||||
* Recompute the stashed list of spares, with status information
|
* Recompute the stashed list of spares, with status information
|
||||||
* this time.
|
* this time.
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_remove(spa->spa_spares.sav_config, ZPOOL_CONFIG_SPARES,
|
fnvlist_remove(spa->spa_spares.sav_config, ZPOOL_CONFIG_SPARES);
|
||||||
DATA_TYPE_NVLIST_ARRAY) == 0);
|
|
||||||
|
|
||||||
spares = kmem_alloc(spa->spa_spares.sav_count * sizeof (void *),
|
spares = kmem_alloc(spa->spa_spares.sav_count * sizeof (void *),
|
||||||
KM_SLEEP);
|
KM_SLEEP);
|
||||||
for (i = 0; i < spa->spa_spares.sav_count; i++)
|
for (i = 0; i < spa->spa_spares.sav_count; i++)
|
||||||
spares[i] = vdev_config_generate(spa,
|
spares[i] = vdev_config_generate(spa,
|
||||||
spa->spa_spares.sav_vdevs[i], B_TRUE, VDEV_CONFIG_SPARE);
|
spa->spa_spares.sav_vdevs[i], B_TRUE, VDEV_CONFIG_SPARE);
|
||||||
VERIFY(nvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
fnvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
||||||
ZPOOL_CONFIG_SPARES, spares, spa->spa_spares.sav_count) == 0);
|
ZPOOL_CONFIG_SPARES, spares, spa->spa_spares.sav_count);
|
||||||
for (i = 0; i < spa->spa_spares.sav_count; i++)
|
for (i = 0; i < spa->spa_spares.sav_count; i++)
|
||||||
nvlist_free(spares[i]);
|
nvlist_free(spares[i]);
|
||||||
kmem_free(spares, spa->spa_spares.sav_count * sizeof (void *));
|
kmem_free(spares, spa->spa_spares.sav_count * sizeof (void *));
|
||||||
|
@ -1909,16 +1908,15 @@ spa_load_l2cache(spa_t *spa)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY(nvlist_lookup_nvlist_array(sav->sav_config,
|
VERIFY0(nvlist_lookup_nvlist_array(sav->sav_config,
|
||||||
ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0);
|
ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache));
|
||||||
newvdevs = kmem_alloc(nl2cache * sizeof (void *), KM_SLEEP);
|
newvdevs = kmem_alloc(nl2cache * sizeof (void *), KM_SLEEP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process new nvlist of vdevs.
|
* Process new nvlist of vdevs.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < nl2cache; i++) {
|
for (i = 0; i < nl2cache; i++) {
|
||||||
VERIFY(nvlist_lookup_uint64(l2cache[i], ZPOOL_CONFIG_GUID,
|
guid = fnvlist_lookup_uint64(l2cache[i], ZPOOL_CONFIG_GUID);
|
||||||
&guid) == 0);
|
|
||||||
|
|
||||||
newvdevs[i] = NULL;
|
newvdevs[i] = NULL;
|
||||||
for (j = 0; j < oldnvdevs; j++) {
|
for (j = 0; j < oldnvdevs; j++) {
|
||||||
|
@ -1979,8 +1977,7 @@ spa_load_l2cache(spa_t *spa)
|
||||||
* Recompute the stashed list of l2cache devices, with status
|
* Recompute the stashed list of l2cache devices, with status
|
||||||
* information this time.
|
* information this time.
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_remove(sav->sav_config, ZPOOL_CONFIG_L2CACHE,
|
fnvlist_remove(sav->sav_config, ZPOOL_CONFIG_L2CACHE);
|
||||||
DATA_TYPE_NVLIST_ARRAY) == 0);
|
|
||||||
|
|
||||||
if (sav->sav_count > 0)
|
if (sav->sav_count > 0)
|
||||||
l2cache = kmem_alloc(sav->sav_count * sizeof (void *),
|
l2cache = kmem_alloc(sav->sav_count * sizeof (void *),
|
||||||
|
@ -1988,8 +1985,8 @@ spa_load_l2cache(spa_t *spa)
|
||||||
for (i = 0; i < sav->sav_count; i++)
|
for (i = 0; i < sav->sav_count; i++)
|
||||||
l2cache[i] = vdev_config_generate(spa,
|
l2cache[i] = vdev_config_generate(spa,
|
||||||
sav->sav_vdevs[i], B_TRUE, VDEV_CONFIG_L2CACHE);
|
sav->sav_vdevs[i], B_TRUE, VDEV_CONFIG_L2CACHE);
|
||||||
VERIFY(nvlist_add_nvlist_array(sav->sav_config,
|
fnvlist_add_nvlist_array(sav->sav_config, ZPOOL_CONFIG_L2CACHE, l2cache,
|
||||||
ZPOOL_CONFIG_L2CACHE, l2cache, sav->sav_count) == 0);
|
sav->sav_count);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/*
|
/*
|
||||||
|
@ -2099,7 +2096,7 @@ spa_check_for_missing_logs(spa_t *spa)
|
||||||
|
|
||||||
child = kmem_alloc(rvd->vdev_children * sizeof (nvlist_t *),
|
child = kmem_alloc(rvd->vdev_children * sizeof (nvlist_t *),
|
||||||
KM_SLEEP);
|
KM_SLEEP);
|
||||||
VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
nv = fnvlist_alloc();
|
||||||
|
|
||||||
for (uint64_t c = 0; c < rvd->vdev_children; c++) {
|
for (uint64_t c = 0; c < rvd->vdev_children; c++) {
|
||||||
vdev_t *tvd = rvd->vdev_child[c];
|
vdev_t *tvd = rvd->vdev_child[c];
|
||||||
|
@ -2404,12 +2401,12 @@ spa_load_verify(spa_t *spa)
|
||||||
spa->spa_load_txg_ts = spa->spa_uberblock.ub_timestamp;
|
spa->spa_load_txg_ts = spa->spa_uberblock.ub_timestamp;
|
||||||
|
|
||||||
loss = spa->spa_last_ubsync_txg_ts - spa->spa_load_txg_ts;
|
loss = spa->spa_last_ubsync_txg_ts - spa->spa_load_txg_ts;
|
||||||
VERIFY(nvlist_add_uint64(spa->spa_load_info,
|
fnvlist_add_uint64(spa->spa_load_info, ZPOOL_CONFIG_LOAD_TIME,
|
||||||
ZPOOL_CONFIG_LOAD_TIME, spa->spa_load_txg_ts) == 0);
|
spa->spa_load_txg_ts);
|
||||||
VERIFY(nvlist_add_int64(spa->spa_load_info,
|
fnvlist_add_int64(spa->spa_load_info, ZPOOL_CONFIG_REWIND_TIME,
|
||||||
ZPOOL_CONFIG_REWIND_TIME, loss) == 0);
|
loss);
|
||||||
VERIFY(nvlist_add_uint64(spa->spa_load_info,
|
fnvlist_add_uint64(spa->spa_load_info,
|
||||||
ZPOOL_CONFIG_LOAD_DATA_ERRORS, sle.sle_data_count) == 0);
|
ZPOOL_CONFIG_LOAD_DATA_ERRORS, sle.sle_data_count);
|
||||||
} else {
|
} else {
|
||||||
spa->spa_load_max_txg = spa->spa_uberblock.ub_txg;
|
spa->spa_load_max_txg = spa->spa_uberblock.ub_txg;
|
||||||
}
|
}
|
||||||
|
@ -3662,7 +3659,7 @@ spa_ld_select_uberblock(spa_t *spa, spa_import_type_t type)
|
||||||
* from the label.
|
* from the label.
|
||||||
*/
|
*/
|
||||||
nvlist_free(spa->spa_label_features);
|
nvlist_free(spa->spa_label_features);
|
||||||
VERIFY(nvlist_dup(features, &spa->spa_label_features, 0) == 0);
|
spa->spa_label_features = fnvlist_dup(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
nvlist_free(label);
|
nvlist_free(label);
|
||||||
|
@ -3675,21 +3672,20 @@ spa_ld_select_uberblock(spa_t *spa, spa_import_type_t type)
|
||||||
if (ub->ub_version >= SPA_VERSION_FEATURES) {
|
if (ub->ub_version >= SPA_VERSION_FEATURES) {
|
||||||
nvlist_t *unsup_feat;
|
nvlist_t *unsup_feat;
|
||||||
|
|
||||||
VERIFY(nvlist_alloc(&unsup_feat, NV_UNIQUE_NAME, KM_SLEEP) ==
|
unsup_feat = fnvlist_alloc();
|
||||||
0);
|
|
||||||
|
|
||||||
for (nvpair_t *nvp = nvlist_next_nvpair(spa->spa_label_features,
|
for (nvpair_t *nvp = nvlist_next_nvpair(spa->spa_label_features,
|
||||||
NULL); nvp != NULL;
|
NULL); nvp != NULL;
|
||||||
nvp = nvlist_next_nvpair(spa->spa_label_features, nvp)) {
|
nvp = nvlist_next_nvpair(spa->spa_label_features, nvp)) {
|
||||||
if (!zfeature_is_supported(nvpair_name(nvp))) {
|
if (!zfeature_is_supported(nvpair_name(nvp))) {
|
||||||
VERIFY(nvlist_add_string(unsup_feat,
|
fnvlist_add_string(unsup_feat,
|
||||||
nvpair_name(nvp), "") == 0);
|
nvpair_name(nvp), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nvlist_empty(unsup_feat)) {
|
if (!nvlist_empty(unsup_feat)) {
|
||||||
VERIFY(nvlist_add_nvlist(spa->spa_load_info,
|
fnvlist_add_nvlist(spa->spa_load_info,
|
||||||
ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat) == 0);
|
ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat);
|
||||||
nvlist_free(unsup_feat);
|
nvlist_free(unsup_feat);
|
||||||
spa_load_failed(spa, "some features are unsupported");
|
spa_load_failed(spa, "some features are unsupported");
|
||||||
return (spa_vdev_err(rvd, VDEV_AUX_UNSUP_FEAT,
|
return (spa_vdev_err(rvd, VDEV_AUX_UNSUP_FEAT,
|
||||||
|
@ -5196,11 +5192,10 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
|
||||||
* attempted vdev_open(). Return this to the user.
|
* attempted vdev_open(). Return this to the user.
|
||||||
*/
|
*/
|
||||||
if (config != NULL && spa->spa_config) {
|
if (config != NULL && spa->spa_config) {
|
||||||
VERIFY(nvlist_dup(spa->spa_config, config,
|
*config = fnvlist_dup(spa->spa_config);
|
||||||
KM_SLEEP) == 0);
|
fnvlist_add_nvlist(*config,
|
||||||
VERIFY(nvlist_add_nvlist(*config,
|
|
||||||
ZPOOL_CONFIG_LOAD_INFO,
|
ZPOOL_CONFIG_LOAD_INFO,
|
||||||
spa->spa_load_info) == 0);
|
spa->spa_load_info);
|
||||||
}
|
}
|
||||||
spa_unload(spa);
|
spa_unload(spa);
|
||||||
spa_deactivate(spa);
|
spa_deactivate(spa);
|
||||||
|
@ -5222,8 +5217,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
|
||||||
* gathered while doing the load.
|
* gathered while doing the load.
|
||||||
*/
|
*/
|
||||||
if (state == SPA_LOAD_RECOVER) {
|
if (state == SPA_LOAD_RECOVER) {
|
||||||
VERIFY(nvlist_add_nvlist(*config, ZPOOL_CONFIG_LOAD_INFO,
|
fnvlist_add_nvlist(*config, ZPOOL_CONFIG_LOAD_INFO,
|
||||||
spa->spa_load_info) == 0);
|
spa->spa_load_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locked) {
|
if (locked) {
|
||||||
|
@ -5301,15 +5296,14 @@ spa_add_spares(spa_t *spa, nvlist_t *config)
|
||||||
if (spa->spa_spares.sav_count == 0)
|
if (spa->spa_spares.sav_count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VERIFY(nvlist_lookup_nvlist(config,
|
nvroot = fnvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE);
|
||||||
ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
|
VERIFY0(nvlist_lookup_nvlist_array(spa->spa_spares.sav_config,
|
||||||
VERIFY(nvlist_lookup_nvlist_array(spa->spa_spares.sav_config,
|
ZPOOL_CONFIG_SPARES, &spares, &nspares));
|
||||||
ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0);
|
|
||||||
if (nspares != 0) {
|
if (nspares != 0) {
|
||||||
VERIFY(nvlist_add_nvlist_array(nvroot,
|
fnvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES, spares,
|
||||||
ZPOOL_CONFIG_SPARES, spares, nspares) == 0);
|
nspares);
|
||||||
VERIFY(nvlist_lookup_nvlist_array(nvroot,
|
VERIFY0(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
||||||
ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0);
|
&spares, &nspares));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Go through and find any spares which have since been
|
* Go through and find any spares which have since been
|
||||||
|
@ -5317,13 +5311,13 @@ spa_add_spares(spa_t *spa, nvlist_t *config)
|
||||||
* their status appropriately.
|
* their status appropriately.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < nspares; i++) {
|
for (i = 0; i < nspares; i++) {
|
||||||
VERIFY(nvlist_lookup_uint64(spares[i],
|
guid = fnvlist_lookup_uint64(spares[i],
|
||||||
ZPOOL_CONFIG_GUID, &guid) == 0);
|
ZPOOL_CONFIG_GUID);
|
||||||
if (spa_spare_exists(guid, &pool, NULL) &&
|
if (spa_spare_exists(guid, &pool, NULL) &&
|
||||||
pool != 0ULL) {
|
pool != 0ULL) {
|
||||||
VERIFY(nvlist_lookup_uint64_array(
|
VERIFY0(nvlist_lookup_uint64_array(spares[i],
|
||||||
spares[i], ZPOOL_CONFIG_VDEV_STATS,
|
ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs,
|
||||||
(uint64_t **)&vs, &vsc) == 0);
|
&vsc));
|
||||||
vs->vs_state = VDEV_STATE_CANT_OPEN;
|
vs->vs_state = VDEV_STATE_CANT_OPEN;
|
||||||
vs->vs_aux = VDEV_AUX_SPARED;
|
vs->vs_aux = VDEV_AUX_SPARED;
|
||||||
}
|
}
|
||||||
|
@ -5350,23 +5344,22 @@ spa_add_l2cache(spa_t *spa, nvlist_t *config)
|
||||||
if (spa->spa_l2cache.sav_count == 0)
|
if (spa->spa_l2cache.sav_count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VERIFY(nvlist_lookup_nvlist(config,
|
nvroot = fnvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE);
|
||||||
ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
|
VERIFY0(nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config,
|
||||||
VERIFY(nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config,
|
ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache));
|
||||||
ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0);
|
|
||||||
if (nl2cache != 0) {
|
if (nl2cache != 0) {
|
||||||
VERIFY(nvlist_add_nvlist_array(nvroot,
|
fnvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE, l2cache,
|
||||||
ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache) == 0);
|
nl2cache);
|
||||||
VERIFY(nvlist_lookup_nvlist_array(nvroot,
|
VERIFY0(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
|
||||||
ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0);
|
&l2cache, &nl2cache));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update level 2 cache device stats.
|
* Update level 2 cache device stats.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < nl2cache; i++) {
|
for (i = 0; i < nl2cache; i++) {
|
||||||
VERIFY(nvlist_lookup_uint64(l2cache[i],
|
guid = fnvlist_lookup_uint64(l2cache[i],
|
||||||
ZPOOL_CONFIG_GUID, &guid) == 0);
|
ZPOOL_CONFIG_GUID);
|
||||||
|
|
||||||
vd = NULL;
|
vd = NULL;
|
||||||
for (j = 0; j < spa->spa_l2cache.sav_count; j++) {
|
for (j = 0; j < spa->spa_l2cache.sav_count; j++) {
|
||||||
|
@ -5378,9 +5371,8 @@ spa_add_l2cache(spa_t *spa, nvlist_t *config)
|
||||||
}
|
}
|
||||||
ASSERT(vd != NULL);
|
ASSERT(vd != NULL);
|
||||||
|
|
||||||
VERIFY(nvlist_lookup_uint64_array(l2cache[i],
|
VERIFY0(nvlist_lookup_uint64_array(l2cache[i],
|
||||||
ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs, &vsc)
|
ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs, &vsc));
|
||||||
== 0);
|
|
||||||
vdev_get_stats(vd, vs);
|
vdev_get_stats(vd, vs);
|
||||||
vdev_config_generate_stats(vd, l2cache[i]);
|
vdev_config_generate_stats(vd, l2cache[i]);
|
||||||
|
|
||||||
|
@ -5495,20 +5487,20 @@ spa_get_stats(const char *name, nvlist_t **config,
|
||||||
|
|
||||||
loadtimes[0] = spa->spa_loaded_ts.tv_sec;
|
loadtimes[0] = spa->spa_loaded_ts.tv_sec;
|
||||||
loadtimes[1] = spa->spa_loaded_ts.tv_nsec;
|
loadtimes[1] = spa->spa_loaded_ts.tv_nsec;
|
||||||
VERIFY(nvlist_add_uint64_array(*config,
|
fnvlist_add_uint64_array(*config,
|
||||||
ZPOOL_CONFIG_LOADED_TIME, loadtimes, 2) == 0);
|
ZPOOL_CONFIG_LOADED_TIME, loadtimes, 2);
|
||||||
|
|
||||||
VERIFY(nvlist_add_uint64(*config,
|
fnvlist_add_uint64(*config,
|
||||||
ZPOOL_CONFIG_ERRCOUNT,
|
ZPOOL_CONFIG_ERRCOUNT,
|
||||||
spa_get_errlog_size(spa)) == 0);
|
spa_get_errlog_size(spa));
|
||||||
|
|
||||||
if (spa_suspended(spa)) {
|
if (spa_suspended(spa)) {
|
||||||
VERIFY(nvlist_add_uint64(*config,
|
fnvlist_add_uint64(*config,
|
||||||
ZPOOL_CONFIG_SUSPENDED,
|
ZPOOL_CONFIG_SUSPENDED,
|
||||||
spa->spa_failmode) == 0);
|
spa->spa_failmode);
|
||||||
VERIFY(nvlist_add_uint64(*config,
|
fnvlist_add_uint64(*config,
|
||||||
ZPOOL_CONFIG_SUSPENDED_REASON,
|
ZPOOL_CONFIG_SUSPENDED_REASON,
|
||||||
spa->spa_suspended) == 0);
|
spa->spa_suspended);
|
||||||
}
|
}
|
||||||
|
|
||||||
spa_add_spares(spa, *config);
|
spa_add_spares(spa, *config);
|
||||||
|
@ -5600,8 +5592,8 @@ spa_validate_aux_devs(spa_t *spa, nvlist_t *nvroot, uint64_t crtxg, int mode,
|
||||||
|
|
||||||
if ((error = vdev_open(vd)) == 0 &&
|
if ((error = vdev_open(vd)) == 0 &&
|
||||||
(error = vdev_label_init(vd, crtxg, label)) == 0) {
|
(error = vdev_label_init(vd, crtxg, label)) == 0) {
|
||||||
VERIFY(nvlist_add_uint64(dev[i], ZPOOL_CONFIG_GUID,
|
fnvlist_add_uint64(dev[i], ZPOOL_CONFIG_GUID,
|
||||||
vd->vdev_guid) == 0);
|
vd->vdev_guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
vdev_free(vd);
|
vdev_free(vd);
|
||||||
|
@ -5652,23 +5644,20 @@ spa_set_aux_vdevs(spa_aux_vdev_t *sav, nvlist_t **devs, int ndevs,
|
||||||
* Generate new dev list by concatenating with the
|
* Generate new dev list by concatenating with the
|
||||||
* current dev list.
|
* current dev list.
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_lookup_nvlist_array(sav->sav_config, config,
|
VERIFY0(nvlist_lookup_nvlist_array(sav->sav_config, config,
|
||||||
&olddevs, &oldndevs) == 0);
|
&olddevs, &oldndevs));
|
||||||
|
|
||||||
newdevs = kmem_alloc(sizeof (void *) *
|
newdevs = kmem_alloc(sizeof (void *) *
|
||||||
(ndevs + oldndevs), KM_SLEEP);
|
(ndevs + oldndevs), KM_SLEEP);
|
||||||
for (i = 0; i < oldndevs; i++)
|
for (i = 0; i < oldndevs; i++)
|
||||||
VERIFY(nvlist_dup(olddevs[i], &newdevs[i],
|
newdevs[i] = fnvlist_dup(olddevs[i]);
|
||||||
KM_SLEEP) == 0);
|
|
||||||
for (i = 0; i < ndevs; i++)
|
for (i = 0; i < ndevs; i++)
|
||||||
VERIFY(nvlist_dup(devs[i], &newdevs[i + oldndevs],
|
newdevs[i + oldndevs] = fnvlist_dup(devs[i]);
|
||||||
KM_SLEEP) == 0);
|
|
||||||
|
|
||||||
VERIFY(nvlist_remove(sav->sav_config, config,
|
fnvlist_remove(sav->sav_config, config);
|
||||||
DATA_TYPE_NVLIST_ARRAY) == 0);
|
|
||||||
|
|
||||||
VERIFY(nvlist_add_nvlist_array(sav->sav_config,
|
fnvlist_add_nvlist_array(sav->sav_config, config, newdevs,
|
||||||
config, newdevs, ndevs + oldndevs) == 0);
|
ndevs + oldndevs);
|
||||||
for (i = 0; i < oldndevs + ndevs; i++)
|
for (i = 0; i < oldndevs + ndevs; i++)
|
||||||
nvlist_free(newdevs[i]);
|
nvlist_free(newdevs[i]);
|
||||||
kmem_free(newdevs, (oldndevs + ndevs) * sizeof (void *));
|
kmem_free(newdevs, (oldndevs + ndevs) * sizeof (void *));
|
||||||
|
@ -5676,10 +5665,8 @@ spa_set_aux_vdevs(spa_aux_vdev_t *sav, nvlist_t **devs, int ndevs,
|
||||||
/*
|
/*
|
||||||
* Generate a new dev list.
|
* Generate a new dev list.
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_alloc(&sav->sav_config, NV_UNIQUE_NAME,
|
sav->sav_config = fnvlist_alloc();
|
||||||
KM_SLEEP) == 0);
|
fnvlist_add_nvlist_array(sav->sav_config, config, devs, ndevs);
|
||||||
VERIFY(nvlist_add_nvlist_array(sav->sav_config, config,
|
|
||||||
devs, ndevs) == 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5888,10 +5875,9 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
|
||||||
*/
|
*/
|
||||||
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
||||||
&spares, &nspares) == 0) {
|
&spares, &nspares) == 0) {
|
||||||
VERIFY(nvlist_alloc(&spa->spa_spares.sav_config, NV_UNIQUE_NAME,
|
spa->spa_spares.sav_config = fnvlist_alloc();
|
||||||
KM_SLEEP) == 0);
|
fnvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
||||||
VERIFY(nvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
ZPOOL_CONFIG_SPARES, spares, nspares);
|
||||||
ZPOOL_CONFIG_SPARES, spares, nspares) == 0);
|
|
||||||
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
||||||
spa_load_spares(spa);
|
spa_load_spares(spa);
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
|
@ -5903,10 +5889,9 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
|
||||||
*/
|
*/
|
||||||
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
|
||||||
&l2cache, &nl2cache) == 0) {
|
&l2cache, &nl2cache) == 0) {
|
||||||
VERIFY(nvlist_alloc(&spa->spa_l2cache.sav_config,
|
spa->spa_l2cache.sav_config = fnvlist_alloc();
|
||||||
NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
fnvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
|
||||||
VERIFY(nvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
|
ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache);
|
||||||
ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache) == 0);
|
|
||||||
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
||||||
spa_load_l2cache(spa);
|
spa_load_l2cache(spa);
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
|
@ -6107,8 +6092,7 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
|
||||||
* Propagate anything learned while loading the pool and pass it
|
* Propagate anything learned while loading the pool and pass it
|
||||||
* back to caller (i.e. rewind info, missing devices, etc).
|
* back to caller (i.e. rewind info, missing devices, etc).
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
|
fnvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, spa->spa_load_info);
|
||||||
spa->spa_load_info) == 0);
|
|
||||||
|
|
||||||
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
||||||
/*
|
/*
|
||||||
|
@ -6126,8 +6110,7 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
|
||||||
spa_load_l2cache(spa);
|
spa_load_l2cache(spa);
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
nvroot = fnvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE);
|
||||||
&nvroot) == 0);
|
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
|
|
||||||
if (props != NULL)
|
if (props != NULL)
|
||||||
|
@ -6151,13 +6134,12 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
|
||||||
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
||||||
&spares, &nspares) == 0) {
|
&spares, &nspares) == 0) {
|
||||||
if (spa->spa_spares.sav_config)
|
if (spa->spa_spares.sav_config)
|
||||||
VERIFY(nvlist_remove(spa->spa_spares.sav_config,
|
fnvlist_remove(spa->spa_spares.sav_config,
|
||||||
ZPOOL_CONFIG_SPARES, DATA_TYPE_NVLIST_ARRAY) == 0);
|
ZPOOL_CONFIG_SPARES);
|
||||||
else
|
else
|
||||||
VERIFY(nvlist_alloc(&spa->spa_spares.sav_config,
|
spa->spa_spares.sav_config = fnvlist_alloc();
|
||||||
NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
fnvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
||||||
VERIFY(nvlist_add_nvlist_array(spa->spa_spares.sav_config,
|
ZPOOL_CONFIG_SPARES, spares, nspares);
|
||||||
ZPOOL_CONFIG_SPARES, spares, nspares) == 0);
|
|
||||||
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
||||||
spa_load_spares(spa);
|
spa_load_spares(spa);
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
|
@ -6166,13 +6148,12 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
|
||||||
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
|
||||||
&l2cache, &nl2cache) == 0) {
|
&l2cache, &nl2cache) == 0) {
|
||||||
if (spa->spa_l2cache.sav_config)
|
if (spa->spa_l2cache.sav_config)
|
||||||
VERIFY(nvlist_remove(spa->spa_l2cache.sav_config,
|
fnvlist_remove(spa->spa_l2cache.sav_config,
|
||||||
ZPOOL_CONFIG_L2CACHE, DATA_TYPE_NVLIST_ARRAY) == 0);
|
ZPOOL_CONFIG_L2CACHE);
|
||||||
else
|
else
|
||||||
VERIFY(nvlist_alloc(&spa->spa_l2cache.sav_config,
|
spa->spa_l2cache.sav_config = fnvlist_alloc();
|
||||||
NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
fnvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
|
||||||
VERIFY(nvlist_add_nvlist_array(spa->spa_l2cache.sav_config,
|
ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache);
|
||||||
ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache) == 0);
|
|
||||||
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
|
||||||
spa_load_l2cache(spa);
|
spa_load_l2cache(spa);
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
|
@ -6262,16 +6243,14 @@ spa_tryimport(nvlist_t *tryconfig)
|
||||||
*/
|
*/
|
||||||
if (spa->spa_root_vdev != NULL) {
|
if (spa->spa_root_vdev != NULL) {
|
||||||
config = spa_config_generate(spa, NULL, -1ULL, B_TRUE);
|
config = spa_config_generate(spa, NULL, -1ULL, B_TRUE);
|
||||||
VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME,
|
fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, poolname);
|
||||||
poolname) == 0);
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, state);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_TIMESTAMP,
|
||||||
state) == 0);
|
spa->spa_uberblock.ub_timestamp);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_TIMESTAMP,
|
fnvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
|
||||||
spa->spa_uberblock.ub_timestamp) == 0);
|
spa->spa_load_info);
|
||||||
VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_ERRATA,
|
||||||
spa->spa_load_info) == 0);
|
spa->spa_errata);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_ERRATA,
|
|
||||||
spa->spa_errata) == 0);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the bootfs property exists on this pool then we
|
* If the bootfs property exists on this pool then we
|
||||||
|
@ -6300,8 +6279,8 @@ spa_tryimport(nvlist_t *tryconfig)
|
||||||
(void) snprintf(dsname, MAXPATHLEN,
|
(void) snprintf(dsname, MAXPATHLEN,
|
||||||
"%s/%s", poolname, ++cp);
|
"%s/%s", poolname, ++cp);
|
||||||
}
|
}
|
||||||
VERIFY(nvlist_add_string(config,
|
fnvlist_add_string(config, ZPOOL_CONFIG_BOOTFS,
|
||||||
ZPOOL_CONFIG_BOOTFS, dsname) == 0);
|
dsname);
|
||||||
kmem_free(dsname, MAXPATHLEN);
|
kmem_free(dsname, MAXPATHLEN);
|
||||||
}
|
}
|
||||||
kmem_free(tmpname, MAXPATHLEN);
|
kmem_free(tmpname, MAXPATHLEN);
|
||||||
|
@ -6468,7 +6447,7 @@ export_spa:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldconfig && spa->spa_config)
|
if (oldconfig && spa->spa_config)
|
||||||
VERIFY(nvlist_dup(spa->spa_config, oldconfig, 0) == 0);
|
*oldconfig = fnvlist_dup(spa->spa_config);
|
||||||
|
|
||||||
if (new_state != POOL_STATE_UNINITIALIZED) {
|
if (new_state != POOL_STATE_UNINITIALIZED) {
|
||||||
if (!hardforce)
|
if (!hardforce)
|
||||||
|
@ -7611,14 +7590,14 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we need certain info from the top level */
|
/* we need certain info from the top level */
|
||||||
VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_METASLAB_ARRAY,
|
fnvlist_add_uint64(child[c], ZPOOL_CONFIG_METASLAB_ARRAY,
|
||||||
vml[c]->vdev_top->vdev_ms_array) == 0);
|
vml[c]->vdev_top->vdev_ms_array);
|
||||||
VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_METASLAB_SHIFT,
|
fnvlist_add_uint64(child[c], ZPOOL_CONFIG_METASLAB_SHIFT,
|
||||||
vml[c]->vdev_top->vdev_ms_shift) == 0);
|
vml[c]->vdev_top->vdev_ms_shift);
|
||||||
VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_ASIZE,
|
fnvlist_add_uint64(child[c], ZPOOL_CONFIG_ASIZE,
|
||||||
vml[c]->vdev_top->vdev_asize) == 0);
|
vml[c]->vdev_top->vdev_asize);
|
||||||
VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_ASHIFT,
|
fnvlist_add_uint64(child[c], ZPOOL_CONFIG_ASHIFT,
|
||||||
vml[c]->vdev_top->vdev_ashift) == 0);
|
vml[c]->vdev_top->vdev_ashift);
|
||||||
|
|
||||||
/* transfer per-vdev ZAPs */
|
/* transfer per-vdev ZAPs */
|
||||||
ASSERT3U(vml[c]->vdev_leaf_zap, !=, 0);
|
ASSERT3U(vml[c]->vdev_leaf_zap, !=, 0);
|
||||||
|
@ -7648,28 +7627,24 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
|
||||||
* Temporarily record the splitting vdevs in the spa config. This
|
* Temporarily record the splitting vdevs in the spa config. This
|
||||||
* will disappear once the config is regenerated.
|
* will disappear once the config is regenerated.
|
||||||
*/
|
*/
|
||||||
VERIFY(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
nvl = fnvlist_alloc();
|
||||||
VERIFY(nvlist_add_uint64_array(nvl, ZPOOL_CONFIG_SPLIT_LIST,
|
fnvlist_add_uint64_array(nvl, ZPOOL_CONFIG_SPLIT_LIST, glist, children);
|
||||||
glist, children) == 0);
|
|
||||||
kmem_free(glist, children * sizeof (uint64_t));
|
kmem_free(glist, children * sizeof (uint64_t));
|
||||||
|
|
||||||
mutex_enter(&spa->spa_props_lock);
|
mutex_enter(&spa->spa_props_lock);
|
||||||
VERIFY(nvlist_add_nvlist(spa->spa_config, ZPOOL_CONFIG_SPLIT,
|
fnvlist_add_nvlist(spa->spa_config, ZPOOL_CONFIG_SPLIT, nvl);
|
||||||
nvl) == 0);
|
|
||||||
mutex_exit(&spa->spa_props_lock);
|
mutex_exit(&spa->spa_props_lock);
|
||||||
spa->spa_config_splitting = nvl;
|
spa->spa_config_splitting = nvl;
|
||||||
vdev_config_dirty(spa->spa_root_vdev);
|
vdev_config_dirty(spa->spa_root_vdev);
|
||||||
|
|
||||||
/* configure and create the new pool */
|
/* configure and create the new pool */
|
||||||
VERIFY(nvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, newname) == 0);
|
fnvlist_add_string(config, ZPOOL_CONFIG_POOL_NAME, newname);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE,
|
||||||
exp ? POOL_STATE_EXPORTED : POOL_STATE_ACTIVE) == 0);
|
exp ? POOL_STATE_EXPORTED : POOL_STATE_ACTIVE);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_VERSION,
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_VERSION, spa_version(spa));
|
||||||
spa_version(spa)) == 0);
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, spa->spa_config_txg);
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG,
|
fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
||||||
spa->spa_config_txg) == 0);
|
spa_generate_guid(NULL));
|
||||||
VERIFY(nvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID,
|
|
||||||
spa_generate_guid(NULL)) == 0);
|
|
||||||
VERIFY0(nvlist_add_boolean(config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS));
|
VERIFY0(nvlist_add_boolean(config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS));
|
||||||
(void) nvlist_lookup_string(props,
|
(void) nvlist_lookup_string(props,
|
||||||
zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot);
|
zpool_prop_to_name(ZPOOL_PROP_ALTROOT), &altroot);
|
||||||
|
@ -7731,10 +7706,9 @@ spa_vdev_split_mirror(spa_t *spa, char *newname, nvlist_t *config,
|
||||||
|
|
||||||
/* if that worked, generate a real config for the new pool */
|
/* if that worked, generate a real config for the new pool */
|
||||||
if (newspa->spa_root_vdev != NULL) {
|
if (newspa->spa_root_vdev != NULL) {
|
||||||
VERIFY(nvlist_alloc(&newspa->spa_config_splitting,
|
newspa->spa_config_splitting = fnvlist_alloc();
|
||||||
NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
fnvlist_add_uint64(newspa->spa_config_splitting,
|
||||||
VERIFY(nvlist_add_uint64(newspa->spa_config_splitting,
|
ZPOOL_CONFIG_SPLIT_GUID, spa_guid(spa));
|
||||||
ZPOOL_CONFIG_SPLIT_GUID, spa_guid(spa)) == 0);
|
|
||||||
spa_config_set(newspa, spa_config_generate(newspa, NULL, -1ULL,
|
spa_config_set(newspa, spa_config_generate(newspa, NULL, -1ULL,
|
||||||
B_TRUE));
|
B_TRUE));
|
||||||
}
|
}
|
||||||
|
@ -8522,16 +8496,15 @@ spa_sync_aux_dev(spa_t *spa, spa_aux_vdev_t *sav, dmu_tx_t *tx,
|
||||||
&sav->sav_object, tx) == 0);
|
&sav->sav_object, tx) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, KM_SLEEP) == 0);
|
nvroot = fnvlist_alloc();
|
||||||
if (sav->sav_count == 0) {
|
if (sav->sav_count == 0) {
|
||||||
VERIFY(nvlist_add_nvlist_array(nvroot, config, NULL, 0) == 0);
|
fnvlist_add_nvlist_array(nvroot, config, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
list = kmem_alloc(sav->sav_count*sizeof (void *), KM_SLEEP);
|
list = kmem_alloc(sav->sav_count*sizeof (void *), KM_SLEEP);
|
||||||
for (i = 0; i < sav->sav_count; i++)
|
for (i = 0; i < sav->sav_count; i++)
|
||||||
list[i] = vdev_config_generate(spa, sav->sav_vdevs[i],
|
list[i] = vdev_config_generate(spa, sav->sav_vdevs[i],
|
||||||
B_FALSE, VDEV_CONFIG_L2CACHE);
|
B_FALSE, VDEV_CONFIG_L2CACHE);
|
||||||
VERIFY(nvlist_add_nvlist_array(nvroot, config, list,
|
fnvlist_add_nvlist_array(nvroot, config, list, sav->sav_count);
|
||||||
sav->sav_count) == 0);
|
|
||||||
for (i = 0; i < sav->sav_count; i++)
|
for (i = 0; i < sav->sav_count; i++)
|
||||||
nvlist_free(list[i]);
|
nvlist_free(list[i]);
|
||||||
kmem_free(list, sav->sav_count * sizeof (void *));
|
kmem_free(list, sav->sav_count * sizeof (void *));
|
||||||
|
|
Loading…
Reference in New Issue