fsgofer: add extension prepare hooks#13223
Open
shayonj wants to merge 1 commit into
Open
Conversation
Custom fsgofer extensions may need to prepare state before the gofer drops capabilities and enters its final root. For example, an extension may need to register gofer flags, open resources, and pass file descriptor numbers through the gofer re-exec path. Allow extensions to optionally define SetFlags and PrepareGofer methods. SetFlags can add gofer flags during command setup. PrepareGofer runs after root setup and before capability application; its FlagOverrides are merged into the arguments used for gofer re-exec. This keeps the base Extension interface focused on mount handling while allowing extensions that need early preparation to opt in. No behavior changes when no registered extension defines these optional methods.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Custom fsgofer extensions may need to prepare state before the gofer drops capabilities and enters its final root. For example, an extension may need to register gofer flags, open resources, and pass file descriptor numbers through the gofer re-exec path.
This is a proposal to allow extensions to optionally define
SetFlagsandPrepareGofermethods.SetFlagscan add gofer flags during command setup.PrepareGoferruns after root setup and before capability application and itsFlagOverridesare merged into the arguments used for gofer re-exec.This keeps the base Extension interface focused on mount handling while allowing extensions that need early preparation to opt in. No behavior changes when no registered extension defines these optional methods.
Related: #12950