summaryrefslogtreecommitdiff
path: root/include/linux/once.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-06-07 20:05:02 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-06-19 22:06:28 -0400
commitda9ba564bd683374b8d319756f312821b8265b06 (patch)
tree14608d249e7d2a5cd33b5ec86e28943330f74608 /include/linux/once.h
parente297a783e41560b44e3c14f38e420cba518113b8 (diff)
random: add get_random_{bytes,u32,u64,int,long,once}_wait family
These functions are simple convenience wrappers that call wait_for_random_bytes before calling the respective get_random_* function. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/once.h')
-rw-r--r--include/linux/once.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/once.h b/include/linux/once.h
index 285f12cb40e6..9c98aaa87cbc 100644
--- a/include/linux/once.h
+++ b/include/linux/once.h
@@ -53,5 +53,7 @@ void __do_once_done(bool *done, struct static_key *once_key,
#define get_random_once(buf, nbytes) \
DO_ONCE(get_random_bytes, (buf), (nbytes))
+#define get_random_once_wait(buf, nbytes) \
+ DO_ONCE(get_random_bytes_wait, (buf), (nbytes)) \
#endif /* _LINUX_ONCE_H */