]> www.infradead.org Git - users/willy/xarray.git/commit
bcachefs: add printbuf arg to bch2_parse_mount_opts()
authorThomas Bertschinger <tahbertschinger@gmail.com>
Tue, 28 May 2024 04:36:09 +0000 (22:36 -0600)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 14 Jul 2024 23:00:12 +0000 (19:00 -0400)
commit9b7f0b5d3d220ccba3151b95a5532780e04e1954
treee62f4cc609591827e26cc5aa5d5f65223fc74b0c
parent7773df19c35fabdcc8c36176a480a1b19ad32866
bcachefs: add printbuf arg to bch2_parse_mount_opts()

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: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/chardev.c
fs/bcachefs/fs.c
fs/bcachefs/opts.c
fs/bcachefs/opts.h