bcachefs: target_congested -> get_random_u32_below()

get_random_u32_below() has a better algorithm than bch2_rand_range(),
it just didn't exist at the time.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-03-13 09:56:07 -04:00
parent 3bcde88d38
commit 69a5a13a22

View File

@ -59,7 +59,7 @@ static bool bch2_target_congested(struct bch_fs *c, u16 target)
}
rcu_read_unlock();
return bch2_rand_range(nr * CONGESTED_MAX) < total;
return get_random_u32_below(nr * CONGESTED_MAX) < total;
}
#else