Skip to content

Commit 69a5a13

Browse files
author
Kent Overstreet
committed
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 <[email protected]>
1 parent 3bcde88 commit 69a5a13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/io_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static bool bch2_target_congested(struct bch_fs *c, u16 target)
5959
}
6060
rcu_read_unlock();
6161

62-
return bch2_rand_range(nr * CONGESTED_MAX) < total;
62+
return get_random_u32_below(nr * CONGESTED_MAX) < total;
6363
}
6464

6565
#else

0 commit comments

Comments
 (0)