Lines Matching refs:spa

174 spa_features_check(spa_t *spa, boolean_t for_write,  in spa_features_check()  argument
177 objset_t *os = spa->spa_meta_objset; in spa_features_check()
182 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in spa_features_check()
204 if (zap_lookup(os, spa->spa_feat_desc_obj, in spa_features_check()
226 feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) in feature_get_refcount() argument
229 if (spa->spa_feat_refcount_cache[feature->fi_feature] == in feature_get_refcount()
233 *res = spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_get_refcount()
243 feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature, in feature_get_refcount_from_disk() argument
249 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_get_refcount_from_disk()
258 err = zap_lookup(spa->spa_meta_objset, zapobj, in feature_get_refcount_from_disk()
272 feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) in feature_get_enabled_txg() argument
274 uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj; in feature_get_enabled_txg()
279 if (!spa_feature_is_enabled(spa, feature->fi_feature)) { in feature_get_enabled_txg()
285 VERIFY0(zap_lookup(spa->spa_meta_objset, spa->spa_feat_enabled_txg_obj, in feature_get_enabled_txg()
296 feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount, in feature_sync() argument
301 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_sync()
303 VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid, in feature_sync()
315 &spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_sync()
321 spa_deactivate_mos_feature(spa, feature->fi_guid); in feature_sync()
323 spa_activate_mos_feature(spa, feature->fi_guid, tx); in feature_sync()
331 feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx) in feature_enable_sync() argument
336 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_enable_sync()
340 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in feature_enable_sync()
345 if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0) in feature_enable_sync()
349 spa_feature_enable(spa, feature->fi_depends[i], tx); in feature_enable_sync()
351 VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj, in feature_enable_sync()
355 feature_sync(spa, feature, initial_refcount, tx); in feature_enable_sync()
357 if (spa_feature_is_enabled(spa, SPA_FEATURE_ENABLED_TXG)) { in feature_enable_sync()
360 if (spa->spa_feat_enabled_txg_obj == 0ULL) { in feature_enable_sync()
361 spa->spa_feat_enabled_txg_obj = in feature_enable_sync()
362 zap_create_link(spa->spa_meta_objset, in feature_enable_sync()
366 spa_feature_incr(spa, SPA_FEATURE_ENABLED_TXG, tx); in feature_enable_sync()
368 VERIFY0(zap_add(spa->spa_meta_objset, in feature_enable_sync()
369 spa->spa_feat_enabled_txg_obj, feature->fi_guid, in feature_enable_sync()
380 if (spa->spa_errata == ZPOOL_ERRATA_ZOL_8308_ENCRYPTION && in feature_enable_sync()
381 spa_feature_is_enabled(spa, SPA_FEATURE_ENCRYPTION) && in feature_enable_sync()
382 !spa_feature_is_active(spa, SPA_FEATURE_ENCRYPTION) && in feature_enable_sync()
384 spa->spa_errata = 0; in feature_enable_sync()
388 feature_do_action(spa_t *spa, spa_feature_t fid, feature_action_t action, in feature_do_action() argument
394 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_do_action()
401 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in feature_do_action()
403 VERIFY3U(feature_get_refcount(spa, feature, &refcount), !=, ENOTSUP); in feature_do_action()
419 feature_sync(spa, feature, refcount, tx); in feature_do_action()
423 spa_feature_create_zap_objects(spa_t *spa, dmu_tx_t *tx) in spa_feature_create_zap_objects() argument
429 ASSERT((!spa->spa_sync_on && tx->tx_txg == TXG_INITIAL) || in spa_feature_create_zap_objects()
430 dsl_pool_sync_context(spa_get_dsl(spa))); in spa_feature_create_zap_objects()
432 spa->spa_feat_for_read_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
435 spa->spa_feat_for_write_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
438 spa->spa_feat_desc_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
447 spa_feature_enable(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_enable() argument
449 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in spa_feature_enable()
451 feature_enable_sync(spa, &spa_feature_table[fid], tx); in spa_feature_enable()
455 spa_feature_incr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_incr() argument
457 feature_do_action(spa, fid, FEATURE_ACTION_INCR, tx); in spa_feature_incr()
461 spa_feature_decr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_decr() argument
463 feature_do_action(spa, fid, FEATURE_ACTION_DECR, tx); in spa_feature_decr()
467 spa_feature_is_enabled(spa_t *spa, spa_feature_t fid) in spa_feature_is_enabled() argument
473 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_is_enabled()
476 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount); in spa_feature_is_enabled()
482 spa_feature_is_active(spa_t *spa, spa_feature_t fid) in spa_feature_is_active() argument
488 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_is_active()
491 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount); in spa_feature_is_active()
506 spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) in spa_feature_enabled_txg() argument
511 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_enabled_txg()
514 err = feature_get_enabled_txg(spa, &spa_feature_table[fid], txg); in spa_feature_enabled_txg()