diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2015-10-08 01:20:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-08 14:26:36 +0200 |
commit | c90aeb948222a7b3d3391d232ec4f50fd8322ad3 (patch) | |
tree | c4625885c7705076fb157b6394fa3969b44bd9f3 /lib/random32.c | |
parent | net: move net_get_random_once to lib (diff) | |
download | linux-c90aeb948222a7b3d3391d232ec4f50fd8322ad3.tar.xz linux-c90aeb948222a7b3d3391d232ec4f50fd8322ad3.zip |
once: make helper generic for calling functions once
Make the get_random_once() helper generic enough, so that functions
in general would only be called once, where one user of this is then
net_get_random_once().
The only implementation specific call is to get_random_bytes(), all
the rest of this *_once() facility would be duplicated among different
subsystems otherwise. The new DO_ONCE() helper will be used by prandom()
later on, but might also be useful for other scenarios/subsystems as
well where a one-time initialization in often-called, possibly fast
path code could occur.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/random32.c')
0 files changed, 0 insertions, 0 deletions