OSDN Git Service

staging: lustre: replace cfs_rand() with prandom_u32_max()
authorNeilBrown <neilb@suse.com>
Mon, 18 Dec 2017 01:41:42 +0000 (12:41 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:44 +0000 (16:03 +0100)
commitbcfa98a50763a0f781a8441d1994ae1456816219
tree682748195d661e6a8f1f16d52e8cea5e78be3359
parent19ae89d32503493315dec77919815d3add851389
staging: lustre: replace cfs_rand() with prandom_u32_max()

All occurrences of
   cfs_rand() % X
are replaced with
   prandom_u32_max(X)

cfs_rand() is a simple Linear Congruential PRNG.  prandom_u32_max()
is at least as random, is seeded with more randomness, and uses
cpu-local state to avoid cross-cpu issues.

This is the first step is discarding the libcfs prng with
the standard linux prng.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/libcfs/fail.c
drivers/staging/lustre/lnet/lnet/net_fault.c
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lustre/mgc/mgc_request.c