1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_BKEY_METHODS_H
3 #define _BCACHEFS_BKEY_METHODS_H
12 extern const char * const bch_bkey_types[];
18 * The keys were mergeable, but would have overflowed size - so instead
19 * l was changed to the maximum size, and both keys were modified:
26 /* Returns reason for being invalid if invalid, else NULL: */
27 const char * (*key_invalid)(const struct bch_fs *,
29 void (*key_debugcheck)(struct bch_fs *, struct btree *,
31 void (*val_to_text)(struct printbuf *, struct bch_fs *,
33 void (*swab)(const struct bkey_format *, struct bkey_packed *);
34 bool (*key_normalize)(struct bch_fs *, struct bkey_s);
35 enum merge_result (*key_merge)(struct bch_fs *,
36 struct bkey_s, struct bkey_s);
39 const char *bch2_bkey_val_invalid(struct bch_fs *, struct bkey_s_c);
40 const char *__bch2_bkey_invalid(struct bch_fs *, struct bkey_s_c,
41 enum btree_node_type);
42 const char *bch2_bkey_invalid(struct bch_fs *, struct bkey_s_c,
43 enum btree_node_type);
44 const char *bch2_bkey_in_btree_node(struct btree *, struct bkey_s_c);
46 void bch2_bkey_debugcheck(struct bch_fs *, struct btree *, struct bkey_s_c);
48 void bch2_bpos_to_text(struct printbuf *, struct bpos);
49 void bch2_bkey_to_text(struct printbuf *, const struct bkey *);
50 void bch2_val_to_text(struct printbuf *, struct bch_fs *,
52 void bch2_bkey_val_to_text(struct printbuf *, struct bch_fs *,
55 void bch2_bkey_swab(const struct bkey_format *, struct bkey_packed *);
57 bool bch2_bkey_normalize(struct bch_fs *, struct bkey_s);
59 enum merge_result bch2_bkey_merge(struct bch_fs *,
60 struct bkey_s, struct bkey_s);
62 void bch2_bkey_renumber(enum btree_node_type, struct bkey_packed *, int);
64 #endif /* _BCACHEFS_BKEY_METHODS_H */