summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Schlueter <schlueter.tim@linux.com>2018-12-09 13:20:52 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2018-12-27 11:38:37 -0500
commit77e8452b0161cee86af7e248f8f7a1ffec27422b (patch)
tree5ed0a78357238121ba5df09b7aa88a0d91284273
parentc4279eb0bfa3153b12a6a282c75a3d1f410342f7 (diff)
bcachefs: Fix bkey_method compilation on gcc 7.3.0
-rw-r--r--fs/bcachefs/bkey_methods.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c
index 6b04bef7fae6..48c86e52e058 100644
--- a/fs/bcachefs/bkey_methods.c
+++ b/fs/bcachefs/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,