summaryrefslogtreecommitdiff
path: root/fs/bcachefs/backpointers.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-17 15:36:46 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:53 -0400
commit564fbd9dd6329abde8aca143da26ffbada13ff7d (patch)
treef1fd8e7668765da321f9fec4d125c6e43947bfd7 /fs/bcachefs/backpointers.c
parent0cc1bc84d69138531d8a5e163caa57dfacd58cf2 (diff)
bcachefs: Fix a 64 bit divide
This fixes a build failure on 32 bit Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/backpointers.c')
-rw-r--r--fs/bcachefs/backpointers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c
index c269fc73a41d..e001f4191671 100644
--- a/fs/bcachefs/backpointers.c
+++ b/fs/bcachefs/backpointers.c
@@ -738,7 +738,7 @@ static size_t btree_nodes_fit_in_ram(struct bch_fs *c)
si_meminfo(&i);
mem_bytes = i.totalram * i.mem_unit;
- return (mem_bytes >> 1) / btree_bytes(c);
+ return div_u64(mem_bytes >> 1, btree_bytes(c));
}
int bch2_get_btree_in_memory_pos(struct btree_trans *trans,