]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/reflink.h
Update bcachefs sources to 13bb4cdf89 bcachefs: Indirect inline data extents
[bcachefs-tools-debian] / libbcachefs / reflink.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_REFLINK_H
3 #define _BCACHEFS_REFLINK_H
4
5 const char *bch2_reflink_p_invalid(const struct bch_fs *, struct bkey_s_c);
6 void bch2_reflink_p_to_text(struct printbuf *, struct bch_fs *,
7                             struct bkey_s_c);
8 enum merge_result bch2_reflink_p_merge(struct bch_fs *,
9                                        struct bkey_s, struct bkey_s);
10
11 #define bch2_bkey_ops_reflink_p (struct bkey_ops) {             \
12         .key_invalid    = bch2_reflink_p_invalid,               \
13         .val_to_text    = bch2_reflink_p_to_text,               \
14         .key_merge      = bch2_reflink_p_merge,         \
15 }
16
17 const char *bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c);
18 void bch2_reflink_v_to_text(struct printbuf *, struct bch_fs *,
19                             struct bkey_s_c);
20
21 #define bch2_bkey_ops_reflink_v (struct bkey_ops) {             \
22         .key_invalid    = bch2_reflink_v_invalid,               \
23         .val_to_text    = bch2_reflink_v_to_text,               \
24         .swab           = bch2_ptr_swab,                        \
25 }
26
27 const char *bch2_indirect_inline_data_invalid(const struct bch_fs *,
28                                               struct bkey_s_c);
29 void bch2_indirect_inline_data_to_text(struct printbuf *,
30                                 struct bch_fs *, struct bkey_s_c);
31
32 #define bch2_bkey_ops_indirect_inline_data (struct bkey_ops) {  \
33         .key_invalid    = bch2_indirect_inline_data_invalid,    \
34         .val_to_text    = bch2_indirect_inline_data_to_text,    \
35 }
36
37 s64 bch2_remap_range(struct bch_fs *, struct bpos, struct bpos,
38                      u64, u64 *, u64, s64 *);
39
40 #endif /* _BCACHEFS_REFLINK_H */