Whamcloud - gitweb
LU-9859 libcfs: replace cfs_rand() with prandom_u32_max() 72/35272/3
authorNeilBrown <neilb@suse.com>
Thu, 20 Jun 2019 02:57:13 +0000 (22:57 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 27 Jun 2019 21:33:57 +0000 (21:33 +0000)
commit7a707d4828807b45aeca368e707c243ba68fa51f
tree34c30eb4d4e4d356de739cf1b100f751c30538f9
parent37d6d157a2a94e022f2e153c9191aa559daec321
LU-9859 libcfs: 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.

Linux-commit: bcfa98a50763a0f781a8441d1994ae1456816219

Change-Id: I63679c269b72f4c4860cb3a47225178edf2d7892
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-on: https://review.whamcloud.com/35272
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
contrib/scripts/spelling.txt
libcfs/libcfs/fail.c
lnet/lnet/net_fault.c
lnet/lnet/router.c
lustre/lmv/lmv_qos.c
lustre/lod/lod_qos.c
lustre/mgc/mgc_request.c
lustre/obdclass/llog_test.c
lustre/ptlrpc/nrs_delay.c