summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bkey_methods.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-11-27 01:09:32 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:32 +0300
commit9ba68f6cdc79b0eab707bf8b50f418da05b6ff5e (patch)
treeb6abad40b0159df17c4804e115f2bb41c3978bb0 /fs/bcachefs/bkey_methods.c
parent5934a0caf2b5dc25a17ee652a95f25c86fffbcd6 (diff)
downloadlinux-9ba68f6cdc79b0eab707bf8b50f418da05b6ff5e.tar.xz
bcachefs: Switch to macro for bkey_ops
Older versions of gcc refuse to compile it the other way Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_methods.c')
-rw-r--r--fs/bcachefs/bkey_methods.c8
1 files changed, 4 insertions, 4 deletions
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,