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;
204 if (zap_lookup(os, spa->spa_feat_desc_obj,
226 feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res)
229 if (spa->spa_feat_refcount_cache[feature->fi_feature] ==
233 *res = spa->spa_feat_refcount_cache[feature->fi_feature];
243 feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature,
249 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
258 err = zap_lookup(spa->spa_meta_objset, zapobj,
272 feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res)
274 uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj;
279 if (!spa_feature_is_enabled(spa, feature->fi_feature)) {
285 VERIFY0(zap_lookup(spa->spa_meta_objset, spa->spa_feat_enabled_txg_obj,
296 feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount,
301 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
303 VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid,
315 &spa->spa_feat_refcount_cache[feature->fi_feature];
321 spa_deactivate_mos_feature(spa, feature->fi_guid);
323 spa_activate_mos_feature(spa, feature->fi_guid, tx);
331 feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)
336 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
340 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
345 if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0)
349 spa_feature_enable(spa, feature->fi_depends[i], tx);
351 VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj,
355 feature_sync(spa, feature, initial_refcount, tx);
357 if (spa_feature_is_enabled(spa, SPA_FEATURE_ENABLED_TXG)) {
360 if (spa->spa_feat_enabled_txg_obj == 0ULL) {
361 spa->spa_feat_enabled_txg_obj =
362 zap_create_link(spa->spa_meta_objset,
366 spa_feature_incr(spa, SPA_FEATURE_ENABLED_TXG, tx);
368 VERIFY0(zap_add(spa->spa_meta_objset,
369 spa->spa_feat_enabled_txg_obj, feature->fi_guid,
375 feature_do_action(spa_t *spa, spa_feature_t fid, feature_action_t action,
381 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
388 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
390 VERIFY3U(feature_get_refcount(spa, feature, &refcount), !=, ENOTSUP);
406 feature_sync(spa, feature, refcount, tx);
410 spa_feature_create_zap_objects(spa_t *spa, dmu_tx_t *tx)
416 ASSERT(dsl_pool_sync_context(spa_get_dsl(spa)) || (!spa->spa_sync_on &&
419 spa->spa_feat_for_read_obj = zap_create_link(spa->spa_meta_objset,
422 spa->spa_feat_for_write_obj = zap_create_link(spa->spa_meta_objset,
425 spa->spa_feat_desc_obj = zap_create_link(spa->spa_meta_objset,
434 spa_feature_enable(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
436 ASSERT3U(spa_version(spa), >=, SPA_VERSION_FEATURES);
438 feature_enable_sync(spa, &spa_feature_table[fid], tx);
442 spa_feature_incr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
444 feature_do_action(spa, fid, FEATURE_ACTION_INCR, tx);
448 spa_feature_decr(spa_t *spa, spa_feature_t fid, dmu_tx_t *tx)
450 feature_do_action(spa, fid, FEATURE_ACTION_DECR, tx);
454 spa_feature_is_enabled(spa_t *spa, spa_feature_t fid)
460 if (spa_version(spa) < SPA_VERSION_FEATURES)
463 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount);
469 spa_feature_is_active(spa_t *spa, spa_feature_t fid)
475 if (spa_version(spa) < SPA_VERSION_FEATURES)
478 err = feature_get_refcount(spa, &spa_feature_table[fid], &refcount);
493 spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg)
498 if (spa_version(spa) < SPA_VERSION_FEATURES)
501 err = feature_get_enabled_txg(spa, &spa_feature_table[fid], txg);