OSDN Git Service

staging: lustre: replace cfs_srand() calls with add_device_randomness().
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)
commit30f4236aafa81722490e74ded48a9fb2aff013ab
tree8482ff744cc23c165ce12a51cf1c808ccb4ae087
parentbcfa98a50763a0f781a8441d1994ae1456816219
staging: lustre: replace cfs_srand() calls with add_device_randomness().

The only places that cfs_srand is called, the random bits are
mixed with bits from get_random_bytes().  So it is equally effective
to add entropy to either pool.
So we can replace calls to cfs_srand() with calls that add the
entropy with add_device_randomness().  That function adds time-based
entropy, so we can discard the ktime_get_ts64 calls.

One location in lustre_handles.c only adds timebased
entropy.  This cannot improve the entropy provided by get_random_bytes(),
so just discard that call.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/lnet/router.c
drivers/staging/lustre/lustre/llite/super25.c
drivers/staging/lustre/lustre/obdclass/lustre_handles.c