Lines Matching defs:spa
174 spa_features_check(spa_t *spa, boolean_t for_write,
177 objset_t *os = spa->spa_meta_objset;
182 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
208 if (zap_lookup(os, spa->spa_feat_desc_obj,
234 feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res)
237 if (spa->spa_feat_refcount_cache[feature->fi_feature] ==
241 *res = spa->spa_feat_refcount_cache[feature->fi_feature];
251 feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature,
257 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
266 err = zap_lookup(spa->spa_meta_objset, zapobj,
280 feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res)
282 uint64_t enabled_txg_obj __maybe_unused = spa->spa_feat_enabled_txg_obj;
287 if (!spa_feature_is_enabled(spa, feature->fi_feature)) {
293 VERIFY0(zap_lookup(spa->spa_meta_objset, spa->spa_feat_enabled_txg_obj,
304 feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount,
309 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
310 VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid,
322 &spa->spa_feat_refcount_cache[feature->fi_feature];
328 spa_deactivate_mos_feature(spa, feature->fi_guid);
330 spa_activate_mos_feature(spa, feature->fi_guid, tx);
338 feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)
343 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
347 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
352 if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0)
356 spa_feature_enable(spa, feature->fi_depends[i], tx);
358 VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj,
362 feature_sync(spa, feature, initial_refcount, tx);
364 if (spa_feature_is_enabled(spa, SPA_FEATURE_ENABLED_TXG)) {
367 if (spa->spa_feat_enabled_txg_obj == 0ULL) {
368 spa->spa_feat_enabled_txg_obj =
369 zap_create_link(spa->spa_meta_objset,
373 spa_feature_incr(spa, SPA_FEATURE_ENABLED_TXG, tx);
375 VERIFY0(zap_add(spa->spa_meta_objset,
376 spa->spa_feat_enabled_txg_obj, feature->fi_guid,
387 if (spa->spa_errata == ZPOOL_ERRATA_ZOL_8308_ENCRYPTION &&
388 spa_feature_is_enabled(spa, SPA_FEATURE_ENCRYPTION) &&
389 !spa_feature_is_active(spa, SPA_FEATURE_ENCRYPTION) &&
391 spa->spa_errata = 0;
398 spa_upgrade_errlog(spa, tx);
402 feature_do_action(spa_t *spa, spa_feature_t fid, feature_action_t action,
409 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
416 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
418 VERIFY3U(feature_get_refcount(spa, feature, &refcount), !=, ENOTSUP);
434 feature_sync(spa, feature, refcount, tx);
438 spa_feature_create_zap_objects(spa_t *spa, dmu_tx_t *tx)
444 ASSERT((!spa->spa_sync_on && tx->tx_txg == TXG_INITIAL) ||
445 dsl_pool_sync_context(spa_get_dsl(spa)));
447 spa->spa_feat_for_read_obj = zap_create_link(spa->spa_meta_objset,
450 spa->spa_feat_for_write_obj = zap_create_link(spa->spa_meta_objset,
453 spa->spa_feat_desc_obj = zap_create_link(spa->spa_meta_objset,
462 spa_feature_enable(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
464 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
466 feature_enable_sync(spa, &spa_feature_table[fid], tx);
470 spa_feature_incr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
472 feature_do_action(spa, fid, FEATURE_ACTION_INCR, tx);
476 spa_feature_decr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
478 feature_do_action(spa, fid, FEATURE_ACTION_DECR, tx);
482 spa_feature_is_enabled(spa_t *spa, spa_feature_t fid)
488 if (spa_version(spa) < SPA_VERSION_FEATURES)
491 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount);
497 spa_feature_is_active(spa_t *spa, spa_feature_t fid)
503 if (spa_version(spa) < SPA_VERSION_FEATURES)
506 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount);
521 spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg)
526 if (spa_version(spa) < SPA_VERSION_FEATURES)
529 err = feature_get_enabled_txg(spa, &spa_feature_table[fid], txg);