mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
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:
parent
3bcde88d38
commit
69a5a13a22
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user