diff options
| author | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
| commit | b74b953b998bcc2db91b694446f3a2619ec32de6 (patch) | |
| tree | 6ce24caabd730f6ae9287ed0676ec32e6ff31e9d /include/linux/ratelimit.h | |
| parent | abb438526201c6a79949ad45375c051b6681c253 (diff) | |
| parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
Merge commit 'v2.6.36' into kbuild/misc
Update to be able to fix a recent change to scripts/basic/docproc.c
(commit eda603f).
Diffstat (limited to 'include/linux/ratelimit.h')
| -rw-r--r-- | include/linux/ratelimit.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 668cf1bef030..8f69d09a41a5 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #define _LINUX_RATELIMIT_H | 2 | #define _LINUX_RATELIMIT_H |
| 3 | 3 | ||
| 4 | #include <linux/param.h> | 4 | #include <linux/param.h> |
| 5 | #include <linux/spinlock_types.h> | 5 | #include <linux/spinlock.h> |
| 6 | 6 | ||
| 7 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) | 7 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) |
| 8 | #define DEFAULT_RATELIMIT_BURST 10 | 8 | #define DEFAULT_RATELIMIT_BURST 10 |
| @@ -25,6 +25,17 @@ struct ratelimit_state { | |||
| 25 | .burst = burst_init, \ | 25 | .burst = burst_init, \ |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static inline void ratelimit_state_init(struct ratelimit_state *rs, | ||
| 29 | int interval, int burst) | ||
| 30 | { | ||
| 31 | spin_lock_init(&rs->lock); | ||
| 32 | rs->interval = interval; | ||
| 33 | rs->burst = burst; | ||
| 34 | rs->printed = 0; | ||
| 35 | rs->missed = 0; | ||
| 36 | rs->begin = 0; | ||
| 37 | } | ||
| 38 | |||
| 28 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | 39 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); |
| 29 | #define __ratelimit(state) ___ratelimit(state, __func__) | 40 | #define __ratelimit(state) ___ratelimit(state, __func__) |
| 30 | 41 | ||
