Move comment and compatibility properties to the props object. #12283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
As discussed in #12261, the
comment
andcompatibility
properties are stored in the pool config object rather than the properties object. This PR changes the logic to store and load them from theDMU_OT_POOL_PROPS
object.It would also be desirable to detect the legacy configuration and allow migration to the new location [WIP].
Description
In
spa_ld_get_props()
we load the string values from the props ZAP into thespa_comment
andspa_compatibility
variables. A couple of helper functions,spa_prop_fstr()
andspa_stralloc()
have been written to facilitate this.In
spa_ld_parse_config()
we no longer look for theZPOOL_PROP_COMMENT
andZPOOL_PROP_COMPATIBILITY
config entries.In
spa_sync_props()
we move the handling of these properties from the config section to the props section.In order to migrate from the old format to the new, there are a few possibilities:
Honestly, none of these are great options. The third is probably the safest as well as the easiest to implement.
I'm on the fence about this: on the one hand, it would be cleanest to actually have all the configurable pool properties stored in the props object, and there would be fewer special cases to deal with. On the other hand (especially given that both of these properties are just hints to userland rather than influencing kernel behavior), there's no real harm in having them in the config object, and a possible small benefit in having them visible in the cachefile before import.
Thoughts?
Types of changes
Checklist:
Signed-off-by
.