aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-11-03 01:07:16 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-03 15:27:58 -0500
commitf46c483357c2d87606bbefb511321e3efd4baae0 (patch)
treee3276379337a56353cce051d8f7efbc87dc61fdb /include/linux
parent7f6b8876c7e66b0d15af134e2a5b87e55514eb6d (diff)
[PATCH] Add printk_timed_ratelimit()
printk_ratelimit() has global state which makes it not useful for callers which wish to perform ratelimiting at a particular frequency. Add a printk_timed_ratelimit() which utilises caller-provided state storage to permit more flexibility. This function can in fact be used for things other than printk ratelimiting and is perhaps poorly named. Cc: Ulrich Drepper <drepper@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kernel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 80f39cab470a..24b611147adb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -171,6 +171,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x)
171 171
172extern int printk_ratelimit(void); 172extern int printk_ratelimit(void);
173extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); 173extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
174extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
175 unsigned int interval_msec);
174 176
175static inline void console_silent(void) 177static inline void console_silent(void)
176{ 178{