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
273 uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj; in feature_get_enabled_txg()
278 if (!spa_feature_is_enabled(spa, feature->fi_feature)) { in feature_get_enabled_txg()
284 VERIFY0(zap_lookup(spa->spa_meta_objset, spa->spa_feat_enabled_txg_obj, in feature_get_enabled_txg()
295 feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount, in feature_sync() argument
300 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_sync()
302 VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid, in feature_sync()
314 &spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_sync()
320 spa_deactivate_mos_feature(spa, feature->fi_guid); in feature_sync()
322 spa_activate_mos_feature(spa, feature->fi_guid, tx); in feature_sync()
330 feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx) in feature_enable_sync() argument
335 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_enable_sync()
339 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in feature_enable_sync()
344 if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0) in feature_enable_sync()
348 spa_feature_enable(spa, feature->fi_depends[i], tx); in feature_enable_sync()
350 VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj, in feature_enable_sync()
354 feature_sync(spa, feature, initial_refcount, tx); in feature_enable_sync()
356 if (spa_feature_is_enabled(spa, SPA_FEATURE_ENABLED_TXG)) { in feature_enable_sync()
359 if (spa->spa_feat_enabled_txg_obj == 0ULL) { in feature_enable_sync()
360 spa->spa_feat_enabled_txg_obj = in feature_enable_sync()
361 zap_create_link(spa->spa_meta_objset, in feature_enable_sync()
365 spa_feature_incr(spa, SPA_FEATURE_ENABLED_TXG, tx); in feature_enable_sync()
367 VERIFY0(zap_add(spa->spa_meta_objset, in feature_enable_sync()
368 spa->spa_feat_enabled_txg_obj, feature->fi_guid, in feature_enable_sync()
374 feature_do_action(spa_t *spa, spa_feature_t fid, feature_action_t action, in feature_do_action() argument
380 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_do_action()
387 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in feature_do_action()
389 VERIFY3U(feature_get_refcount(spa, feature, &refcount), !=, ENOTSUP); in feature_do_action()
405 feature_sync(spa, feature, refcount, tx); in feature_do_action()
409 spa_feature_create_zap_objects(spa_t *spa, dmu_tx_t *tx) in spa_feature_create_zap_objects() argument
415 ASSERT(dsl_pool_sync_context(spa_get_dsl(spa)) || (!spa->spa_sync_on && in spa_feature_create_zap_objects()
418 spa->spa_feat_for_read_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
421 spa->spa_feat_for_write_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
424 spa->spa_feat_desc_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
433 spa_feature_enable(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_enable() argument
435 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES); in spa_feature_enable()
437 feature_enable_sync(spa, &spa_feature_table[fid], tx); in spa_feature_enable()
441 spa_feature_incr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_incr() argument
443 feature_do_action(spa, fid, FEATURE_ACTION_INCR, tx); in spa_feature_incr()
447 spa_feature_decr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx) in spa_feature_decr() argument
449 feature_do_action(spa, fid, FEATURE_ACTION_DECR, tx); in spa_feature_decr()
453 spa_feature_is_enabled(spa_t *spa, spa_feature_t fid) in spa_feature_is_enabled() argument
459 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_is_enabled()
462 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount); in spa_feature_is_enabled()
468 spa_feature_is_active(spa_t *spa, spa_feature_t fid) in spa_feature_is_active() argument
474 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_is_active()
477 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount); in spa_feature_is_active()
492 spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) { in spa_feature_enabled_txg() argument
496 if (spa_version(spa) < SPA_VERSION_FEATURES) in spa_feature_enabled_txg()
499 err = feature_get_enabled_txg(spa, &spa_feature_table[fid], txg); in spa_feature_enabled_txg()