summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/bset.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-01-16 13:29:59 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-21 13:27:10 -0500
commitec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35 (patch)
tree2ba47c4de8460460489d335e3f562eab8819ce96 /fs/bcachefs/bset.c
parent2acc59dd88d27ad69b66ded80df16c042b04eeec (diff)
downloadlinux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.tar.gz
linux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.tar.bz2
linux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.zip
bcachefs: Prep work for variable size btree node buffers
bcachefs btree nodes are big - typically 256k - and btree roots are pinned in memory. As we're now up to 18 btrees, we now have significant memory overhead in mostly empty btree roots. And in the future we're going to start enforcing that certain btree node boundaries exist, to solve lock contention issues - analagous to XFS's AGIs. Thus, we need to start allocating smaller btree node buffers when we can. This patch changes code that refers to the filesystem constant c->opts.btree_node_size to refer to the btree node buffer size - btree_buf_bytes() - where appropriate. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.c')
-rw-r--r--fs/bcachefs/bset.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/bset.c b/fs/bcachefs/bset.c
index 044fff9b2cf6..3fd1085b6c61 100644
--- a/fs/bcachefs/bset.c
+++ b/fs/bcachefs/bset.c
@@ -823,13 +823,12 @@ void bch2_bset_init_first(struct btree *b, struct bset *i)
set_btree_bset(b, t, i);
}
-void bch2_bset_init_next(struct bch_fs *c, struct btree *b,
- struct btree_node_entry *bne)
+void bch2_bset_init_next(struct btree *b, struct btree_node_entry *bne)
{
struct bset *i = &bne->keys;
struct bset_tree *t;
- BUG_ON(bset_byte_offset(b, bne) >= btree_bytes(c));
+ BUG_ON(bset_byte_offset(b, bne) >= btree_buf_bytes(b));
BUG_ON((void *) bne < (void *) btree_bkey_last(b, bset_tree_last(b)));
BUG_ON(b->nsets >= MAX_BSETS);