• Joe Eykholt's avatar
    lib/random32: export pseudo-random number generator for modules · 5960164f
    Joe Eykholt authored
    This patch moves the definition of struct rnd_state and the inline
    __seed() function to linux/random.h.  It renames the static __random32()
    function to prandom32() and exports it for use in modules.
    
    prandom32() is useful as a privately-seeded pseudo random number generator
    that can give the same result every time it is initialized.
    
    For FCoE FC-BB-6 VN2VN mode self-selected unique FC address generation, we
    need an pseudo-random number generator seeded with the 64-bit world-wide
    port name.  A truly random generator or one seeded with randomness won't
    do because the same sequence of numbers should be generated each time we
    boot or the link comes up.
    
    A prandom32_seed() inline function is added to the header file.  It is
    inlined not for speed, but so the function won't be expanded in the base
    kernel, but only in the module that uses it.
    Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
    Acked-by: default avatarMatt Mackall <mpm@selenic.com>
    Cc: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5960164f
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt/kvm Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...