2013-08-09 22:21:57 +08:00
|
|
|
#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
|
|
|
|
#define _LINUX_JUMP_LABEL_RATELIMIT_H
|
|
|
|
|
|
|
|
#include <linux/jump_label.h>
|
|
|
|
#include <linux/workqueue.h>
|
|
|
|
|
|
|
|
#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
|
|
|
|
struct static_key_deferred {
|
|
|
|
struct static_key key;
|
|
|
|
unsigned long timeout;
|
|
|
|
struct delayed_work work;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_JUMP_LABEL
|
|
|
|
extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
|
2016-12-17 06:30:35 +08:00
|
|
|
extern void static_key_deferred_flush(struct static_key_deferred *key);
|
2013-08-09 22:21:57 +08:00
|
|
|
extern void
|
|
|
|
jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
|
|
|
|
|
|
|
|
#else /* !HAVE_JUMP_LABEL */
|
|
|
|
struct static_key_deferred {
|
|
|
|
struct static_key key;
|
|
|
|
};
|
|
|
|
static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
|
|
|
|
{
|
2013-10-20 03:48:53 +08:00
|
|
|
STATIC_KEY_CHECK_USE();
|
2013-08-09 22:21:57 +08:00
|
|
|
static_key_slow_dec(&key->key);
|
|
|
|
}
|
2016-12-17 06:30:35 +08:00
|
|
|
static inline void static_key_deferred_flush(struct static_key_deferred *key)
|
|
|
|
{
|
|
|
|
STATIC_KEY_CHECK_USE();
|
|
|
|
}
|
2013-08-09 22:21:57 +08:00
|
|
|
static inline void
|
|
|
|
jump_label_rate_limit(struct static_key_deferred *key,
|
|
|
|
unsigned long rl)
|
|
|
|
{
|
2013-10-20 03:48:53 +08:00
|
|
|
STATIC_KEY_CHECK_USE();
|
2013-08-09 22:21:57 +08:00
|
|
|
}
|
|
|
|
#endif /* HAVE_JUMP_LABEL */
|
|
|
|
#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
|