diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-01-15 15:11:22 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:34 -0400 |
commit | 5525f632dc123ed32f17c649a54d07794a873822 (patch) | |
tree | 978a13d6ca9ca83d5971fe59009cebcd8d2cbd22 /fs/bcachefs/btree_cache.h | |
parent | d98a5e39452e08d4d51c2240b0711ea86a62de6d (diff) | |
download | lwn-5525f632dc123ed32f17c649a54d07794a873822.tar.gz lwn-5525f632dc123ed32f17c649a54d07794a873822.zip |
bcachefs: Change btree split threshold to be in u64s
This fixes a bug with very small btree nodes where splitting would end
up with one of the new nodes empty.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_cache.h')
-rw-r--r-- | fs/bcachefs/btree_cache.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_cache.h b/fs/bcachefs/btree_cache.h index 4598a4c57aa1..adacb0a06703 100644 --- a/fs/bcachefs/btree_cache.h +++ b/fs/bcachefs/btree_cache.h @@ -75,7 +75,7 @@ static inline unsigned btree_blocks(struct bch_fs *c) return c->opts.btree_node_size >> c->block_bits; } -#define BTREE_SPLIT_THRESHOLD(c) (btree_blocks(c) * 3 / 4) +#define BTREE_SPLIT_THRESHOLD(c) (btree_max_u64s(c) * 3 / 4) #define BTREE_FOREGROUND_MERGE_THRESHOLD(c) (btree_max_u64s(c) * 1 / 3) #define BTREE_FOREGROUND_MERGE_HYSTERESIS(c) \ |