summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/reflink.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-31 00:03:37 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:29 -0400
commit78668fe0bbd9bd04c0dbc7b9f60dd2c36a9a16a9 (patch)
treeb0c135b4db83dba4af7eff9903ae3a55a2a82f54 /fs/bcachefs/reflink.h
parent1296ab552040e09b35f37b8c523d4f1711ac8435 (diff)
downloadlinux-stable-78668fe0bbd9bd04c0dbc7b9f60dd2c36a9a16a9.tar.gz
linux-stable-78668fe0bbd9bd04c0dbc7b9f60dd2c36a9a16a9.tar.bz2
linux-stable-78668fe0bbd9bd04c0dbc7b9f60dd2c36a9a16a9.zip
bcachefs: Move deletion of refcount=0 indirect extents to their triggers
For backpointers, we need to switch the order triggers are run in: we need to run triggers for deletions/overwrites before triggers for inserts. To avoid breaking the reflink triggers, this patch moves deleting of indirect extents with refcount=0 to their triggers, instead of doing it when we update those keys. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/reflink.h')
-rw-r--r--fs/bcachefs/reflink.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/reflink.h b/fs/bcachefs/reflink.h
index 4da4330014a8..8eb41c0292eb 100644
--- a/fs/bcachefs/reflink.h
+++ b/fs/bcachefs/reflink.h
@@ -18,12 +18,14 @@ bool bch2_reflink_p_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
const char *bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c);
void bch2_reflink_v_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
+int bch2_trans_mark_reflink_v(struct btree_trans *, struct bkey_s_c,
+ struct bkey_i *, unsigned);
#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_extent, \
+ .trans_trigger = bch2_trans_mark_reflink_v, \
.atomic_trigger = bch2_mark_extent, \
}
@@ -31,10 +33,14 @@ const char *bch2_indirect_inline_data_invalid(const struct bch_fs *,
struct bkey_s_c);
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 *,
+ struct bkey_s_c, struct bkey_i *,
+ unsigned);
#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)