summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-14 02:27:55 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:29 +0300
commit3e1547116fe70f49c88e1ee400966a1c7b1bec3a (patch)
treeaed1c4cc0a205642478c18bbdd8525a17394fe34 /fs/bcachefs/alloc_types.h
parentf13fd87a39225eae57d4ddf824a09acb1955abd1 (diff)
downloadlinux-3e1547116fe70f49c88e1ee400966a1c7b1bec3a.tar.xz
bcachefs: x-macroize alloc_reserve enum
This makes an array of strings available, like our other enums. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_types.h')
-rw-r--r--fs/bcachefs/alloc_types.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h
index 409232e3d998..e3a3eb271158 100644
--- a/fs/bcachefs/alloc_types.h
+++ b/fs/bcachefs/alloc_types.h
@@ -22,12 +22,17 @@ enum allocator_states {
#undef x
};
+#define BCH_ALLOC_RESERVES() \
+ x(btree_movinggc) \
+ x(btree) \
+ x(movinggc) \
+ x(none)
+
enum alloc_reserve {
- RESERVE_BTREE_MOVINGGC = -2,
- RESERVE_BTREE = -1,
- RESERVE_MOVINGGC = 0,
- RESERVE_NONE = 1,
- RESERVE_NR = 2,
+#define x(name) RESERVE_##name,
+ BCH_ALLOC_RESERVES()
+#undef x
+ RESERVE_NR
};
typedef FIFO(long) alloc_fifo;