summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs_format.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-12-30 14:37:25 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:36 -0400
commite3e464ac6d09269b19cea3dc32b626db44d0e6ba (patch)
tree7aafd377933161ed88573a5e3dab7ee3d8e0e06a /fs/bcachefs/bcachefs_format.h
parent57b0b3db475de6b724e4db3b827c00484cdde642 (diff)
downloadlwn-e3e464ac6d09269b19cea3dc32b626db44d0e6ba.tar.gz
lwn-e3e464ac6d09269b19cea3dc32b626db44d0e6ba.zip
bcachefs: Move extent overwrite handling out of core btree code
Ever since the btree code was first written, handling of overwriting existing extents - including partially overwriting and splittin existing extents - was handled as part of the core btree insert path. The modern transaction and iterator infrastructure didn't exist then, so that was the only way for it to be done. This patch moves that outside of the core btree code to a pass that runs at transaction commit time. This is a significant simplification to the btree code and overall reduction in code size, but more importantly it gets us much closer to the core btree code being completely independent of extents and is important prep work for snapshots. This introduces a new feature bit; the old and new extent update models are incompatible when the filesystem needs journal replay. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r--fs/bcachefs/bcachefs_format.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h
index d1c0a5d5580e..1ad5ff449a5b 100644
--- a/fs/bcachefs/bcachefs_format.h
+++ b/fs/bcachefs/bcachefs_format.h
@@ -1315,12 +1315,14 @@ LE64_BITMASK(BCH_SB_ERASURE_CODE, struct bch_sb, flags[3], 0, 16);
x(inline_data, 8) \
x(new_extent_overwrite, 9) \
x(incompressible, 10) \
- x(btree_ptr_v2, 11)
+ x(btree_ptr_v2, 11) \
+ x(extents_above_btree_updates, 12)
#define BCH_SB_FEATURES_ALL \
((1ULL << BCH_FEATURE_new_siphash)| \
(1ULL << BCH_FEATURE_new_extent_overwrite)| \
- (1ULL << BCH_FEATURE_btree_ptr_v2))
+ (1ULL << BCH_FEATURE_btree_ptr_v2)| \
+ (1ULL << BCH_FEATURE_extents_above_btree_updates))
enum bch_sb_feature {
#define x(f, n) BCH_FEATURE_##f,