Commit 69a5a13a authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 3bcde88d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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