From: Tim Schlueter Date: Sun, 9 Dec 2018 21:20:52 +0000 (-0800) Subject: bcachefs: Fix bkey_method compilation on gcc 7.3.0 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f9ccc30824a6b9f44b975c8ce952938eff5920f3;p=linux.git bcachefs: Fix bkey_method compilation on gcc 7.3.0 Signed-off-by: Tim Schlueter Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c index f518062d896b8..37c44f087a0b4 100644 --- a/fs/bcachefs/bkey_methods.c +++ b/fs/bcachefs/bkey_methods.c @@ -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,