• Thomas Bertschinger's avatar
    bcachefs: add printbuf arg to bch2_parse_mount_opts() · 9b7f0b5d
    Thomas Bertschinger authored
    Mount options that take the name of a device that may be part of a
    filesystem, for example "metadata_target", cannot be validated until
    after the filesystem has been opened. However, an attempt to parse those
    options may be made prior to the filesystem being opened.
    
    This change adds a printbuf parameter to bch2_parse_mount_opts() which
    will be used to save those mount options, when they are supplied prior
    to the FS being opened, so that they can be parsed later.
    
    This functionality is not currently needed, but will be used after
    bcachefs starts using the new mount API to parse mount options. This is
    because using the new mount API, we will process mount options prior to
    opening the FS, but the new API doesn't provide a convenient way to
    "replay" mount option parsing. So we save these options ourselves to
    accomplish this.
    
    This change also splits out the code to parse a single option into
    bch2_parse_one_mount_opt(), which will be useful when using the new
    mount API which deals with a single mount option at a time.
    Signed-off-by: default avatarThomas Bertschinger <tahbertschinger@gmail.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    9b7f0b5d
fs.c 51.6 KB