diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-21 02:43:48 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 19:47:38 +0300 |
commit | 01e9564540d7e264147e3ee380e85cfa875ef48f (patch) | |
tree | b249d09d790f08bf545651dfea33ba7c8546b7ee /fs/bcachefs/bcachefs_ioctl.h | |
parent | 225879f403c6196624f0ed5c118b2cdd7de02e64 (diff) | |
download | linux-01e9564540d7e264147e3ee380e85cfa875ef48f.tar.xz |
bcachefs: x-macro-ify bch_data_ops enum
This will let us add an enum -> string table for a to_text() fn.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_ioctl.h')
-rw-r--r-- | fs/bcachefs/bcachefs_ioctl.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/bcachefs/bcachefs_ioctl.h b/fs/bcachefs/bcachefs_ioctl.h index 934da1b0e37b..d40ebfe05b0b 100644 --- a/fs/bcachefs/bcachefs_ioctl.h +++ b/fs/bcachefs/bcachefs_ioctl.h @@ -173,12 +173,17 @@ struct bch_ioctl_disk_set_state { __u64 dev; }; +#define BCH_DATA_OPS() \ + x(scrub, 0) \ + x(rereplicate, 1) \ + x(migrate, 2) \ + x(rewrite_old_nodes, 3) + enum bch_data_ops { - BCH_DATA_OP_SCRUB = 0, - BCH_DATA_OP_REREPLICATE = 1, - BCH_DATA_OP_MIGRATE = 2, - BCH_DATA_OP_REWRITE_OLD_NODES = 3, - BCH_DATA_OP_NR = 4, +#define x(t, n) BCH_DATA_OP_##t = n, + BCH_DATA_OPS() +#undef x + BCH_DATA_OP_NR }; /* |