#undef BCH_OPT
};
-static enum bch_opt_id bch2_opt_lookup(const char *name)
+static int bch2_opt_lookup(const char *name)
{
const struct bch_option *i;
if (val) {
id = bch2_opt_lookup(name);
if (id < 0)
- return -EINVAL;
+ continue;
ret = parse_one_opt(id, val, &v);
if (ret < 0)
v = 0;
}
- if (bch2_opt_table[id].type != BCH_OPT_BOOL)
- return -EINVAL;
+ if (id < 0 ||
+ bch2_opt_table[id].type != BCH_OPT_BOOL)
+ continue;
}
bch2_opt_set(opts, id, v);
enum bch_opt_id bch2_parse_sysfs_opt(const char *name, const char *val,
u64 *res)
{
- enum bch_opt_id id = bch2_opt_lookup(name);
+ int id = bch2_opt_lookup(name);
int ret;
if (id < 0)
ssize_t bch2_opt_show(struct bch_opts *opts, const char *name,
char *buf, size_t size)
{
- enum bch_opt_id id = bch2_opt_lookup(name);
+ int id = bch2_opt_lookup(name);
const struct bch_option *opt;
u64 v;