summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoverstreet <kent.overstreet@gmail.com>2018-12-12 05:51:39 -0500
committerGitHub <noreply@github.com>2018-12-12 05:51:39 -0500
commita1eeee30eca81e385b75b811a79a93cc999f99ca (patch)
treeda95b44af5b6aa6eb3456d1718cb531eb68a3eaa
parent5bc155d3fe202ce0e896577ceb10838a4cb0bc8e (diff)
parent569decca7caf75b3af00852634e8950e9e38a0de (diff)
Merge pull request #11 from modelrockettier/bkey-method-fix
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,