diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-24 02:14:55 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:49 +0200 |
commit | 01ad673727b59664c9d12df4e5b6f5bad1ea2825 (patch) | |
tree | db93047878a22efa13d8c91c3229639a5c4ebf79 /fs/bcachefs/opts.c | |
parent | bcachefs: Fix bch_alloc_to_text() (diff) | |
download | linux-01ad673727b59664c9d12df4e5b6f5bad1ea2825.tar.xz linux-01ad673727b59664c9d12df4e5b6f5bad1ea2825.zip |
bcachefs: bch2_inode_opts_get()
This improves io_opts() and makes it a non-inline function - it's big
enough that it probably shouldn't be.
Also, bch_io_opts no longer needs fields for whether options are
defined, so we can slim it down a bit.
We'd like to stop passing around the full bch_io_opts, but that'll be
tricky because of bch2_rebalance_add_key().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r-- | fs/bcachefs/opts.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c index 9c49d543b062..04e2989cd6b3 100644 --- a/fs/bcachefs/opts.c +++ b/fs/bcachefs/opts.c @@ -531,22 +531,11 @@ void bch2_opt_set_sb(struct bch_fs *c, const struct bch_option *opt, u64 v) struct bch_io_opts bch2_opts_to_inode_opts(struct bch_opts src) { - struct bch_io_opts ret = { 0 }; -#define x(_name, _bits) \ - if (opt_defined(src, _name)) \ - opt_set(ret, _name, src._name); - BCH_INODE_OPTS() -#undef x - return ret; -} - -void bch2_io_opts_apply(struct bch_io_opts *dst, struct bch_io_opts src) -{ -#define x(_name, _bits) \ - if (opt_defined(src, _name)) \ - opt_set(*dst, _name, src._name); + return (struct bch_io_opts) { +#define x(_name, _bits) ._name = src._name, BCH_INODE_OPTS() #undef x + }; } bool bch2_opt_is_inode_opt(enum bch_opt_id id) |