From: Kent Overstreet Date: Fri, 13 Nov 2020 19:49:57 +0000 (-0500) Subject: bcachefs: Fix a 64 bit divide X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=101d471367a4b3a9158c53d3ca0093b0bed60338;p=linux.git bcachefs: Fix a 64 bit divide this fixes builds on 32 bit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 0dc01386d1cde..65d9b81266099 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -321,7 +321,7 @@ static u64 reserve_factor(u64 r) static u64 avail_factor(u64 r) { - return (r << RESERVE_FACTOR) / ((1 << RESERVE_FACTOR) + 1); + return div_u64(r << RESERVE_FACTOR, (1 << RESERVE_FACTOR) + 1); } u64 bch2_fs_sectors_used(struct bch_fs *c, struct bch_fs_usage_online *fs_usage)