From 564fbd9dd6329abde8aca143da26ffbada13ff7d Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 17 Feb 2023 15:36:46 -0500 Subject: bcachefs: Fix a 64 bit divide This fixes a build failure on 32 bit Signed-off-by: Kent Overstreet --- fs/bcachefs/backpointers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.3