]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/reflink.h
Update bcachefs sources to 2115a2ffde bcachefs: Kill bch2_verify_bucket_evacuated()
[bcachefs-tools-debian] / libbcachefs / reflink.h
index bfc785619ee89d17270fa75342c85fe4f2712d54..2391037c2ece6ca5ad2ec1ac4c3f69bf7f352037 100644 (file)
@@ -2,37 +2,49 @@
 #ifndef _BCACHEFS_REFLINK_H
 #define _BCACHEFS_REFLINK_H
 
-const char *bch2_reflink_p_invalid(const struct bch_fs *, struct bkey_s_c);
+int bch2_reflink_p_invalid(const struct bch_fs *, struct bkey_s_c,
+                          unsigned, struct printbuf *);
 void bch2_reflink_p_to_text(struct printbuf *, struct bch_fs *,
                            struct bkey_s_c);
-enum merge_result bch2_reflink_p_merge(struct bch_fs *,
-                                      struct bkey_s, struct bkey_s);
+bool bch2_reflink_p_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
 
-#define bch2_bkey_ops_reflink_p (struct bkey_ops) {            \
+#define bch2_bkey_ops_reflink_p ((struct bkey_ops) {           \
        .key_invalid    = bch2_reflink_p_invalid,               \
        .val_to_text    = bch2_reflink_p_to_text,               \
-       .key_merge      = bch2_reflink_p_merge,         \
-}
+       .key_merge      = bch2_reflink_p_merge,                 \
+       .trans_trigger  = bch2_trans_mark_reflink_p,            \
+       .atomic_trigger = bch2_mark_reflink_p,                  \
+})
 
-const char *bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c);
+int bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c,
+                          unsigned, struct printbuf *);
 void bch2_reflink_v_to_text(struct printbuf *, struct bch_fs *,
                            struct bkey_s_c);
+int bch2_trans_mark_reflink_v(struct btree_trans *, enum btree_id, unsigned,
+                             struct bkey_s_c, struct bkey_i *, unsigned);
 
-#define bch2_bkey_ops_reflink_v (struct bkey_ops) {            \
+#define bch2_bkey_ops_reflink_v ((struct bkey_ops) {           \
        .key_invalid    = bch2_reflink_v_invalid,               \
        .val_to_text    = bch2_reflink_v_to_text,               \
        .swab           = bch2_ptr_swab,                        \
-}
+       .trans_trigger  = bch2_trans_mark_reflink_v,            \
+       .atomic_trigger = bch2_mark_extent,                     \
+})
 
-const char *bch2_indirect_inline_data_invalid(const struct bch_fs *,
-                                             struct bkey_s_c);
+int bch2_indirect_inline_data_invalid(const struct bch_fs *, struct bkey_s_c,
+                                     unsigned, struct printbuf *);
 void bch2_indirect_inline_data_to_text(struct printbuf *,
                                struct bch_fs *, struct bkey_s_c);
+int bch2_trans_mark_indirect_inline_data(struct btree_trans *,
+                                        enum btree_id, unsigned,
+                             struct bkey_s_c, struct bkey_i *,
+                             unsigned);
 
-#define bch2_bkey_ops_indirect_inline_data (struct bkey_ops) { \
+#define bch2_bkey_ops_indirect_inline_data ((struct bkey_ops) {        \
        .key_invalid    = bch2_indirect_inline_data_invalid,    \
        .val_to_text    = bch2_indirect_inline_data_to_text,    \
-}
+       .trans_trigger  = bch2_trans_mark_indirect_inline_data, \
+})
 
 static inline const __le64 *bkey_refcount_c(struct bkey_s_c k)
 {
@@ -58,7 +70,7 @@ static inline __le64 *bkey_refcount(struct bkey_i *k)
        }
 }
 
-s64 bch2_remap_range(struct bch_fs *, struct bpos, struct bpos,
-                    u64, u64 *, u64, s64 *);
+s64 bch2_remap_range(struct bch_fs *, subvol_inum, u64,
+                    subvol_inum, u64, u64, u64, s64 *);
 
 #endif /* _BCACHEFS_REFLINK_H */