diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-02-17 13:37:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:53 -0400 |
commit | 0507962f634bc3bada77bce9f3cd839e48aa5fb0 (patch) | |
tree | 1392f9e5eeb3cbccf6eab568d0788d8851e009cb /fs/bcachefs/extents.c | |
parent | 0ef837a0cc87d49d9f7d29bdef5a57f07ecc84d3 (diff) | |
download | lwn-0507962f634bc3bada77bce9f3cd839e48aa5fb0.tar.gz lwn-0507962f634bc3bada77bce9f3cd839e48aa5fb0.zip |
bcachefs: Drop invalid stripe ptrs in fsck
More repair code, now that we can repair extents during initial gc.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/extents.c')
-rw-r--r-- | fs/bcachefs/extents.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index 50ab240d89a8..4007af4a780b 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -777,6 +777,15 @@ void bch2_bkey_mark_replicas_cached(struct bch_fs *c, struct bkey_s k, } } +void bch2_bkey_extent_entry_drop(struct bkey_i *k, union bch_extent_entry *entry) +{ + union bch_extent_entry *end = bkey_val_end(bkey_i_to_s(k)); + union bch_extent_entry *next = extent_entry_next(entry); + + memmove_u64s(entry, next, (u64 *) end - (u64 *) next); + k->k.u64s -= extent_entry_u64s(entry); +} + void bch2_bkey_append_ptr(struct bkey_i *k, struct bch_extent_ptr ptr) { |