]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/reflink.c
Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the comma...
[bcachefs-tools-debian] / libbcachefs / reflink.c
index dbbdf1955f7664ea43b74f8e902eb5de9dd48209..07ddf3e85ee454577f4ef6354e25ab7a89671161 100644 (file)
@@ -28,7 +28,7 @@ static inline unsigned bkey_type_to_indirect(const struct bkey *k)
 
 /* reflink pointers */
 
-int bch2_reflink_p_invalid(const struct bch_fs *c, struct bkey_s_c k,
+int bch2_reflink_p_invalid(struct bch_fs *c, struct bkey_s_c k,
                           enum bkey_invalid_flags flags,
                           struct printbuf *err)
 {
@@ -75,7 +75,7 @@ bool bch2_reflink_p_merge(struct bch_fs *c, struct bkey_s _l, struct bkey_s_c _r
 
 /* indirect extents */
 
-int bch2_reflink_v_invalid(const struct bch_fs *c, struct bkey_s_c k,
+int bch2_reflink_v_invalid(struct bch_fs *c, struct bkey_s_c k,
                           enum bkey_invalid_flags flags,
                           struct printbuf *err)
 {
@@ -126,7 +126,7 @@ int bch2_trans_mark_reflink_v(struct btree_trans *trans,
 
 /* indirect inline data */
 
-int bch2_indirect_inline_data_invalid(const struct bch_fs *c, struct bkey_s_c k,
+int bch2_indirect_inline_data_invalid(struct bch_fs *c, struct bkey_s_c k,
                                      enum bkey_invalid_flags flags,
                                      struct printbuf *err)
 {
@@ -255,7 +255,7 @@ s64 bch2_remap_range(struct bch_fs *c,
        struct bpos dst_end = dst_start, src_end = src_start;
        struct bch_io_opts opts;
        struct bpos src_want;
-       u64 dst_done;
+       u64 dst_done = 0;
        u32 dst_snapshot, src_snapshot;
        int ret = 0, ret2 = 0;
 
@@ -390,7 +390,7 @@ s64 bch2_remap_range(struct bch_fs *c,
                        inode_u.bi_size = new_i_size;
                        ret2  = bch2_inode_write(trans, &inode_iter, &inode_u) ?:
                                bch2_trans_commit(trans, NULL, NULL,
-                                                 BTREE_INSERT_NOFAIL);
+                                                 BCH_TRANS_COMMIT_no_enospc);
                }
 
                bch2_trans_iter_exit(trans, &inode_iter);