bcachefs: Fix a 64 bit divide

this fixes builds on 32 bit.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-11-13 14:49:57 -05:00 committed by Kent Overstreet
parent 35ef6df5ca
commit 101d471367

View file

@ -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)