From 9ba68f6cdc79b0eab707bf8b50f418da05b6ff5e Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 26 Nov 2019 17:09:32 -0500 Subject: bcachefs: Switch to macro for bkey_ops Older versions of gcc refuse to compile it the other way Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/bkey_methods.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fs/bcachefs/bkey_methods.c') diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c index 5312184c37f7..ed448fad83c5 100644 --- a/fs/bcachefs/bkey_methods.c +++ b/fs/bcachefs/bkey_methods.c @@ -75,10 +75,10 @@ static void key_type_inline_data_to_text(struct printbuf *out, struct bch_fs *c, pr_buf(out, "(%zu bytes)", bkey_val_bytes(k.k)); } -static const struct bkey_ops bch2_bkey_ops_inline_data = { - .key_invalid = key_type_inline_data_invalid, - .val_to_text = key_type_inline_data_to_text, -}; +#define bch2_bkey_ops_inline_data (struct bkey_ops) { \ + .key_invalid = key_type_inline_data_invalid, \ + .val_to_text = key_type_inline_data_to_text, \ +} static const struct bkey_ops bch2_bkey_ops[] = { #define x(name, nr) [KEY_TYPE_##name] = bch2_bkey_ops_##name, -- cgit v1.2.3