summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/opts.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-13 03:48:32 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:10:07 +0200
commit9f343e24f541bef3d5f081925eae5734c2c39c28 (patch)
tree50acbc53466bed838042a96a789d43c016ec8c61 /fs/bcachefs/opts.h
parentbcachefs: Convert snapshot table to RCU array (diff)
downloadlinux-9f343e24f541bef3d5f081925eae5734c2c39c28.tar.xz
linux-9f343e24f541bef3d5f081925eae5734c2c39c28.zip
bcachefs: bch_opt_fn
Minor refactoring to get rid of some unneeded token pasting. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.h')
-rw-r--r--fs/bcachefs/opts.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h
index e105a742fd44..3be5095aa472 100644
--- a/fs/bcachefs/opts.h
+++ b/fs/bcachefs/opts.h
@@ -8,6 +8,8 @@
#include <linux/sysfs.h>
#include "bcachefs_format.h"
+struct bch_fs;
+
extern const char * const bch2_error_actions[];
extern const char * const bch2_version_upgrade_opts[];
extern const char * const bch2_sb_features[];
@@ -67,6 +69,11 @@ enum opt_type {
BCH_OPT_FN,
};
+struct bch_opt_fn {
+ int (*parse)(struct bch_fs *, const char *, u64 *, struct printbuf *);
+ void (*to_text)(struct printbuf *, struct bch_fs *, struct bch_sb *, u64);
+};
+
/**
* x(name, shortopt, type, in mem type, mode, sb_opt)
*
@@ -495,8 +502,8 @@ struct bch_option {
u64 min, max;
const char * const *choices;
- int (*parse)(struct bch_fs *, const char *, u64 *);
- void (*to_text)(struct printbuf *, struct bch_fs *, struct bch_sb *, u64);
+
+ struct bch_opt_fn fn;
const char *hint;
const char *help;