summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-28 06:12:06 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:55 +0300
commitf3a65bb98b4612745cf2505734c78404344e2c9e (patch)
treee5ba98f92ea61cd52d57076ed81b5b72251102de /fs/bcachefs/btree_types.h
parent0f2ea6550f1fbfabbe2db276107246c1236018ab (diff)
downloadlinux-f3a65bb98b4612745cf2505734c78404344e2c9e.tar.xz
bcachefs: Convert constants to consts
Rust bindgen doesn't handle macros, but it does handle integer constants: this conversion aids in implementing safe Rust wrapper interfaces. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 38bc2a1d198b..bc4aa26b9486 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -184,33 +184,33 @@ struct btree_node_iter {
/*
* Iterate over all possible positions, synthesizing deleted keys for holes:
*/
-#define BTREE_ITER_SLOTS (1 << 0)
-#define BTREE_ITER_ALL_LEVELS (1 << 1)
+static const u16 BTREE_ITER_SLOTS = 1 << 0;
+static const u16 BTREE_ITER_ALL_LEVELS = 1 << 1;
/*
* Indicates that intent locks should be taken on leaf nodes, because we expect
* to be doing updates:
*/
-#define BTREE_ITER_INTENT (1 << 2)
+static const u16 BTREE_ITER_INTENT = 1 << 2;
/*
* Causes the btree iterator code to prefetch additional btree nodes from disk:
*/
-#define BTREE_ITER_PREFETCH (1 << 3)
+static const u16 BTREE_ITER_PREFETCH = 1 << 3;
/*
* Used in bch2_btree_iter_traverse(), to indicate whether we're searching for
* @pos or the first key strictly greater than @pos
*/
-#define BTREE_ITER_IS_EXTENTS (1 << 4)
-#define BTREE_ITER_NOT_EXTENTS (1 << 5)
-#define BTREE_ITER_CACHED (1 << 6)
-#define BTREE_ITER_WITH_KEY_CACHE (1 << 7)
-#define BTREE_ITER_WITH_UPDATES (1 << 8)
-#define BTREE_ITER_WITH_JOURNAL (1 << 9)
-#define __BTREE_ITER_ALL_SNAPSHOTS (1 << 10)
-#define BTREE_ITER_ALL_SNAPSHOTS (1 << 11)
-#define BTREE_ITER_FILTER_SNAPSHOTS (1 << 12)
-#define BTREE_ITER_NOPRESERVE (1 << 13)
-#define BTREE_ITER_CACHED_NOFILL (1 << 14)
-#define BTREE_ITER_KEY_CACHE_FILL (1 << 15)
+static const u16 BTREE_ITER_IS_EXTENTS = 1 << 4;
+static const u16 BTREE_ITER_NOT_EXTENTS = 1 << 5;
+static const u16 BTREE_ITER_CACHED = 1 << 6;
+static const u16 BTREE_ITER_WITH_KEY_CACHE = 1 << 7;
+static const u16 BTREE_ITER_WITH_UPDATES = 1 << 8;
+static const u16 BTREE_ITER_WITH_JOURNAL = 1 << 9;
+static const u16 __BTREE_ITER_ALL_SNAPSHOTS = 1 << 10;
+static const u16 BTREE_ITER_ALL_SNAPSHOTS = 1 << 11;
+static const u16 BTREE_ITER_FILTER_SNAPSHOTS = 1 << 12;
+static const u16 BTREE_ITER_NOPRESERVE = 1 << 13;
+static const u16 BTREE_ITER_CACHED_NOFILL = 1 << 14;
+static const u16 BTREE_ITER_KEY_CACHE_FILL = 1 << 15;
enum btree_path_uptodate {
BTREE_ITER_UPTODATE = 0,