bcachefs: Fix bkey_method compilation on gcc 7.3.0
authorTim Schlueter <schlueter.tim@linux.com>
Sun, 9 Dec 2018 21:20:52 +0000 (13:20 -0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:13 +0000 (17:08 -0400)
Signed-off-by: Tim Schlueter <schlueter.tim@linux.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bkey_methods.c

index f518062d896b8d0cd88140d7a35d154721fa43a6..37c44f087a0b4befcd98a97ef874cc35472f02d7 100644 (file)
@@ -25,13 +25,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)
 {
@@ -41,9 +41,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)
@@ -54,13 +54,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,