diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-04 18:10:23 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-04 18:10:29 -0400 |
commit | 8642d4ae10f167a2eb850403f6d2b60757242b31 (patch) | |
tree | 6cd7f6586f779a806e7f33c8f3e76aebc1cf1064 /libbcachefs/btree_update.h | |
parent | 1f78fed4693a5361f56508daac59bebd5b556379 (diff) |
Update bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/btree_update.h')
-rw-r--r-- | libbcachefs/btree_update.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libbcachefs/btree_update.h b/libbcachefs/btree_update.h index 1ac3a81e..e90cf292 100644 --- a/libbcachefs/btree_update.h +++ b/libbcachefs/btree_update.h @@ -4,6 +4,7 @@ #include "btree_iter.h" #include "journal.h" +#include "journal.h" struct bch_fs; struct btree; @@ -83,6 +84,28 @@ int bch2_btree_node_update_key(struct btree_trans *, struct btree_iter *, int bch2_btree_node_update_key_get_iter(struct btree_trans *, struct btree *, struct bkey_i *, bool); +int __bch2_insert_snapshot_whiteouts(struct btree_trans *, enum btree_id, + struct bpos, struct bpos); + +/* + * For use when splitting extents in existing snapshots: + * + * If @old_pos is an interior snapshot node, iterate over descendent snapshot + * nodes: for every descendent snapshot in whiche @old_pos is overwritten and + * not visible, emit a whiteout at @new_pos. + */ +static inline int bch2_insert_snapshot_whiteouts(struct btree_trans *trans, + enum btree_id btree, + struct bpos old_pos, + struct bpos new_pos) +{ + if (!btree_type_has_snapshots(btree) || + bkey_eq(old_pos, new_pos)) + return 0; + + return __bch2_insert_snapshot_whiteouts(trans, btree, old_pos, new_pos); +} + int bch2_trans_update_extent(struct btree_trans *, struct btree_iter *, struct bkey_i *, enum btree_update_flags); |