diff options
Diffstat (limited to 'include/linux/net.h')
-rw-r--r-- | include/linux/net.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 049d4b03c4c4..70ac5e28e6b7 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -24,7 +24,8 @@ | |||
24 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | 24 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ |
25 | #include <linux/kmemcheck.h> | 25 | #include <linux/kmemcheck.h> |
26 | #include <linux/rcupdate.h> | 26 | #include <linux/rcupdate.h> |
27 | #include <linux/jump_label.h> | 27 | #include <linux/once.h> |
28 | |||
28 | #include <uapi/linux/net.h> | 29 | #include <uapi/linux/net.h> |
29 | 30 | ||
30 | struct poll_table_struct; | 31 | struct poll_table_struct; |
@@ -250,22 +251,8 @@ do { \ | |||
250 | } while (0) | 251 | } while (0) |
251 | #endif | 252 | #endif |
252 | 253 | ||
253 | bool __net_get_random_once(void *buf, int nbytes, bool *done, | 254 | #define net_get_random_once(buf, nbytes) \ |
254 | struct static_key *done_key); | 255 | get_random_once((buf), (nbytes)) |
255 | |||
256 | #define net_get_random_once(buf, nbytes) \ | ||
257 | ({ \ | ||
258 | bool ___ret = false; \ | ||
259 | static bool ___done = false; \ | ||
260 | static struct static_key ___once_key = \ | ||
261 | STATIC_KEY_INIT_TRUE; \ | ||
262 | if (static_key_true(&___once_key)) \ | ||
263 | ___ret = __net_get_random_once(buf, \ | ||
264 | nbytes, \ | ||
265 | &___done, \ | ||
266 | &___once_key); \ | ||
267 | ___ret; \ | ||
268 | }) | ||
269 | 256 | ||
270 | int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, | 257 | int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, |
271 | size_t num, size_t len); | 258 | size_t num, size_t len); |