Lines Matching +full:non +full:- +full:descriptive
9 * or https://opensource.org/licenses/CDDL-1.0.
37 * -----------------
39 * ZFS feature flags are used to provide fine-grained versioning to the ZFS
40 * on-disk format. Once enabled on a pool feature flags replace the old
43 * Each new on-disk format change will be given a uniquely identifying string
45 * organizations creating new on-disk formats with the same version number. To
51 * ----------------
59 * feature, but the feature has not been used yet, so no on-disk
66 * Feature flags makes no differentiation between non-zero reference counts
74 * It is the responsibility of the individual features to maintain a non-zero
78 * ------------
86 * On-disk Format
87 * --------------
91 * SPA_VERSION_BEFORE_FEATURES (28) first, so all pre-feature flags on disk
98 * 1) features_for_read: feature GUID -> reference count
100 * 2) features_for_write: feature GUID -> reference count
102 * 3) feature_descriptions: feature GUID -> descriptive string
108 * To open a pool in read-only mode only the features listed in
111 * To open the pool in read-write mode features in both features_for_read and
126 * -------------------
141 * Features may not perform enable-time initialization. Instead, any such
143 * enforces that on-disk changes be made only when features are used. Code
156 * has made an on-disk format change. Later, after the destroyed dataset's
159 * decremented back to 0 to indicate that it has undone its on-disk format
170 * this software. Adds each unsupported feature (name -> description) to
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()
193 ASSERT(za->za_integer_length == sizeof (uint64_t) && in spa_features_check()
194 za->za_num_integers == 1); in spa_features_check()
197 fnvlist_add_uint64(enabled_feat, za->za_name, in spa_features_check()
198 za->za_first_integer); in spa_features_check()
201 if (za->za_first_integer != 0 && in spa_features_check()
202 !zfeature_is_supported(za->za_name)) { in spa_features_check()
208 if (zap_lookup(os, spa->spa_feat_desc_obj, in spa_features_check()
209 za->za_name, 1, MAXPATHLEN, buf) == 0) in spa_features_check()
213 za->za_name, desc) == 0); in spa_features_check()
227 * Use an in-memory cache of feature refcounts for quick retrieval.
229 * Note: well-designed features will not need to use this; they should
231 * However, this is non-static for zdb, zhack, and spa_add_feature_stats().
236 ASSERT(VALID_FEATURE_FID(feature->fi_feature)); in feature_get_refcount()
237 if (spa->spa_feat_refcount_cache[feature->fi_feature] == in feature_get_refcount()
241 *res = spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_get_refcount()
246 * Note: well-designed features will not need to use this; they should
248 * However, this is non-static for zdb and zhack.
256 uint64_t zapobj = (feature->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? in feature_get_refcount_from_disk()
257 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_get_refcount_from_disk()
266 err = zap_lookup(spa->spa_meta_objset, zapobj, in feature_get_refcount_from_disk()
267 feature->fi_guid, sizeof (uint64_t), 1, &refcount); in feature_get_refcount_from_disk()
282 uint64_t enabled_txg_obj __maybe_unused = spa->spa_feat_enabled_txg_obj; in feature_get_enabled_txg()
284 ASSERT(zfeature_depends_on(feature->fi_feature, in feature_get_enabled_txg()
287 if (!spa_feature_is_enabled(spa, feature->fi_feature)) { in feature_get_enabled_txg()
293 VERIFY0(zap_lookup(spa->spa_meta_objset, spa->spa_feat_enabled_txg_obj, in feature_get_enabled_txg()
294 feature->fi_guid, sizeof (uint64_t), 1, res)); in feature_get_enabled_txg()
300 * This function is non-static for zhack; it should otherwise not be used
307 ASSERT(VALID_FEATURE_OR_NONE(feature->fi_feature)); in feature_sync()
308 uint64_t zapobj = (feature->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? in feature_sync()
309 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_sync()
310 VERIFY0(zap_update(spa->spa_meta_objset, zapobj, feature->fi_guid, in feature_sync()
320 if (feature->fi_feature != SPA_FEATURE_NONE) { in feature_sync()
322 &spa->spa_feat_refcount_cache[feature->fi_feature]; in feature_sync()
328 spa_deactivate_mos_feature(spa, feature->fi_guid); in feature_sync()
329 else if (feature->fi_flags & ZFEATURE_FLAG_MOS) in feature_sync()
330 spa_activate_mos_feature(spa, feature->fi_guid, tx); in feature_sync()
334 * This function is non-static for zhack; it should otherwise not be used
341 (feature->fi_flags & ZFEATURE_FLAG_ACTIVATE_ON_ENABLE) ? 1 : 0; in feature_enable_sync()
342 uint64_t zapobj = (feature->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? in feature_enable_sync()
343 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_enable_sync()
346 ASSERT(zfeature_is_valid_guid(feature->fi_guid)); in feature_enable_sync()
352 if (zap_contains(spa->spa_meta_objset, zapobj, feature->fi_guid) == 0) in feature_enable_sync()
355 for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) in feature_enable_sync()
356 spa_feature_enable(spa, feature->fi_depends[i], tx); in feature_enable_sync()
358 VERIFY0(zap_update(spa->spa_meta_objset, spa->spa_feat_desc_obj, in feature_enable_sync()
359 feature->fi_guid, 1, strlen(feature->fi_desc) + 1, in feature_enable_sync()
360 feature->fi_desc, tx)); in feature_enable_sync()
367 if (spa->spa_feat_enabled_txg_obj == 0ULL) { in feature_enable_sync()
368 spa->spa_feat_enabled_txg_obj = in feature_enable_sync()
369 zap_create_link(spa->spa_meta_objset, in feature_enable_sync()
375 VERIFY0(zap_add(spa->spa_meta_objset, in feature_enable_sync()
376 spa->spa_feat_enabled_txg_obj, feature->fi_guid, in feature_enable_sync()
387 if (spa->spa_errata == ZPOOL_ERRATA_ZOL_8308_ENCRYPTION && in feature_enable_sync()
390 feature->fi_feature == SPA_FEATURE_BOOKMARK_V2) in feature_enable_sync()
391 spa->spa_errata = 0; in feature_enable_sync()
394 * Convert the old on-disk error log to the new format when activating in feature_enable_sync()
397 if (feature->fi_feature == SPA_FEATURE_HEAD_ERRLOG) in feature_enable_sync()
408 (feature->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ? in feature_do_action()
409 spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj; in feature_do_action()
413 ASSERT(zfeature_is_valid_guid(feature->fi_guid)); in feature_do_action()
427 refcount--; in feature_do_action()
444 ASSERT((!spa->spa_sync_on && tx->tx_txg == TXG_INITIAL) || in spa_feature_create_zap_objects()
447 spa->spa_feat_for_read_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
450 spa->spa_feat_for_write_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()
453 spa->spa_feat_desc_obj = zap_create_link(spa->spa_meta_objset, in spa_feature_create_zap_objects()