]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/jump_label_ratelimit.h
net: rtnetlink: validate IFLA_MTU attribute in rtnl_create_link()
[mirror_ubuntu-bionic-kernel.git] / include / linux / jump_label_ratelimit.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
851cf6e7
AJ
2#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
3#define _LINUX_JUMP_LABEL_RATELIMIT_H
4
5#include <linux/jump_label.h>
6#include <linux/workqueue.h>
7
8#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
9struct static_key_deferred {
10 struct static_key key;
11 unsigned long timeout;
12 struct delayed_work work;
13};
14#endif
15
16#ifdef HAVE_JUMP_LABEL
17extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
b6416e61 18extern void static_key_deferred_flush(struct static_key_deferred *key);
851cf6e7
AJ
19extern void
20jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
21
22#else /* !HAVE_JUMP_LABEL */
23struct static_key_deferred {
24 struct static_key key;
25};
26static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
27{
5cdda511 28 STATIC_KEY_CHECK_USE(key);
851cf6e7
AJ
29 static_key_slow_dec(&key->key);
30}
b6416e61
DM
31static inline void static_key_deferred_flush(struct static_key_deferred *key)
32{
5cdda511 33 STATIC_KEY_CHECK_USE(key);
b6416e61 34}
851cf6e7
AJ
35static inline void
36jump_label_rate_limit(struct static_key_deferred *key,
37 unsigned long rl)
38{
5cdda511 39 STATIC_KEY_CHECK_USE(key);
851cf6e7
AJ
40}
41#endif /* HAVE_JUMP_LABEL */
42#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */