bcachefs: Make bch_option compatible with Rust ffi
authorBrett Holman <bholman.devel@gmail.com>
Tue, 3 May 2022 22:50:57 +0000 (16:50 -0600)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:32 +0000 (17:09 -0400)
Rust FFI lacks support for unnamed structs and unions. The space
saved in bch_option is not enough to be significant.

Signed-off-by: Brett Holman <bholman.devel@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/opts.h

index 863891dcb554d9852e42e7824b86cd194e89ccab..e15ffb07416b82b69dafc28a1db987a50b90766f 100644 (file)
@@ -455,17 +455,9 @@ struct bch_option {
        enum opt_flags          flags;
        u64                     min, max;
 
-       union {
-       struct {
-       };
-       struct {
-               const char * const *choices;
-       };
-       struct {
-               int (*parse)(struct bch_fs *, const char *, u64 *);
-               void (*to_text)(struct printbuf *, struct bch_fs *, struct bch_sb *, u64);
-       };
-       };
+       const char * const *choices;
+       int (*parse)(struct bch_fs *, const char *, u64 *);
+       void (*to_text)(struct printbuf *, struct bch_fs *, struct bch_sb *, u64);
 
        const char              *hint;
        const char              *help;