summaryrefslogtreecommitdiff
path: root/libbcachefs/bkey_methods.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/bkey_methods.c')
-rw-r--r--libbcachefs/bkey_methods.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libbcachefs/bkey_methods.c b/libbcachefs/bkey_methods.c
index 6b04bef7..48c86e52 100644
--- a/libbcachefs/bkey_methods.c
+++ b/libbcachefs/bkey_methods.c
@@ -24,13 +24,13 @@ static const char *deleted_key_invalid(const struct bch_fs *c,
return NULL;
}
-const struct bkey_ops bch2_bkey_ops_deleted = {
- .key_invalid = deleted_key_invalid,
-};
+#define bch2_bkey_ops_deleted (struct bkey_ops) { \
+ .key_invalid = deleted_key_invalid, \
+}
-const struct bkey_ops bch2_bkey_ops_discard = {
- .key_invalid = deleted_key_invalid,
-};
+#define bch2_bkey_ops_discard (struct bkey_ops) { \
+ .key_invalid = deleted_key_invalid, \
+}
static const char *empty_val_key_invalid(const struct bch_fs *c, struct bkey_s_c k)
{
@@ -40,9 +40,9 @@ static const char *empty_val_key_invalid(const struct bch_fs *c, struct bkey_s_c
return NULL;
}
-const struct bkey_ops bch2_bkey_ops_error = {
- .key_invalid = empty_val_key_invalid,
-};
+#define bch2_bkey_ops_error (struct bkey_ops) { \
+ .key_invalid = empty_val_key_invalid, \
+}
static const char *key_type_cookie_invalid(const struct bch_fs *c,
struct bkey_s_c k)
@@ -53,13 +53,13 @@ static const char *key_type_cookie_invalid(const struct bch_fs *c,
return NULL;
}
-const struct bkey_ops bch2_bkey_ops_cookie = {
- .key_invalid = key_type_cookie_invalid,
-};
+#define bch2_bkey_ops_cookie (struct bkey_ops) { \
+ .key_invalid = key_type_cookie_invalid, \
+}
-const struct bkey_ops bch2_bkey_ops_whiteout = {
- .key_invalid = empty_val_key_invalid,
-};
+#define bch2_bkey_ops_whiteout (struct bkey_ops) { \
+ .key_invalid = empty_val_key_invalid, \
+}
static const struct bkey_ops bch2_bkey_ops[] = {
#define x(name, nr) [KEY_TYPE_##name] = bch2_bkey_ops_##name,