summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-08 02:07:09 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-09 00:29:20 +0300
commitf40d13f94df744185f99732e89bc8d085729ecc9 (patch)
treef0575c15e130d0b2a0c6ad459efd8d646bcece4a /fs/bcachefs/buckets.h
parent930e1a92d62d3f0dbf8d27002c539819738ef6bb (diff)
downloadlinux-f40d13f94df744185f99732e89bc8d085729ecc9.tar.xz
bcachefs: Run bch2_check_fix_ptrs() via triggers
Currently, the reflink_p gc trigger does repair as well - turning a reflink_p key into an error key if the reflink_v it points to doesn't exist. This won't work with online check/repair, because the repair path once online will be subject to transaction restarts, but BTREE_TRIGGER_gc is not idempotant - we can't run it multiple times if we get a transaction restart. So we need to split these paths; to do so this patch calls check_fix_ptrs() by a new general path - a new trigger type, BTREE_TRIGGER_check_repair. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r--fs/bcachefs/buckets.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h
index c2c2ac36bee5..df10f390101a 100644
--- a/fs/bcachefs/buckets.h
+++ b/fs/bcachefs/buckets.h
@@ -341,6 +341,10 @@ int bch2_bucket_ref_update(struct btree_trans *, struct bkey_s_c,
const struct bch_extent_ptr *,
s64, enum bch_data_type, u8, u8, u32 *);
+int bch2_check_fix_ptrs(struct btree_trans *,
+ enum btree_id, unsigned, struct bkey_s_c,
+ enum btree_iter_update_trigger_flags);
+
int bch2_trigger_extent(struct btree_trans *, enum btree_id, unsigned,
struct bkey_s_c, struct bkey_s,
enum btree_iter_update_trigger_flags);