diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-26 09:20:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-13 19:59:37 -0400 |
commit | a3f5f075c2e2c52c9c656c54ea77ceff5b2e1e25 (patch) | |
tree | f7d838b53b635b3f19100db6a45f23c101addbc4 /fs/pstore/platform.c | |
parent | b8587daa756141da776e3d4c3a5a315f5af78708 (diff) |
pstore/platform: Make automatic updates interval configurable
There is no behavioural change, the default value is still 60 seconds.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r-- | fs/pstore/platform.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 61461ed9b6c8..34ca3141eb0a 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/uaccess.h> | 32 | #include <linux/uaccess.h> |
33 | #include <linux/hardirq.h> | 33 | #include <linux/hardirq.h> |
34 | #include <linux/jiffies.h> | ||
34 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
35 | 36 | ||
36 | #include "internal.h" | 37 | #include "internal.h" |
@@ -40,7 +41,10 @@ | |||
40 | * whether the system is actually still running well enough | 41 | * whether the system is actually still running well enough |
41 | * to let someone see the entry | 42 | * to let someone see the entry |
42 | */ | 43 | */ |
43 | #define PSTORE_INTERVAL (60 * HZ) | 44 | static int pstore_update_ms = 60000; |
45 | module_param_named(update_ms, pstore_update_ms, int, 0600); | ||
46 | MODULE_PARM_DESC(update_ms, "milliseconds before pstore updates its content " | ||
47 | "(default is 60000; -1 means runtime updates are disabled)"); | ||
44 | 48 | ||
45 | static int pstore_new_entry; | 49 | static int pstore_new_entry; |
46 | 50 | ||
@@ -231,8 +235,11 @@ int pstore_register(struct pstore_info *psi) | |||
231 | kmsg_dump_register(&pstore_dumper); | 235 | kmsg_dump_register(&pstore_dumper); |
232 | pstore_register_console(); | 236 | pstore_register_console(); |
233 | 237 | ||
234 | pstore_timer.expires = jiffies + PSTORE_INTERVAL; | 238 | if (pstore_update_ms >= 0) { |
235 | add_timer(&pstore_timer); | 239 | pstore_timer.expires = jiffies + |
240 | msecs_to_jiffies(pstore_update_ms); | ||
241 | add_timer(&pstore_timer); | ||
242 | } | ||
236 | 243 | ||
237 | return 0; | 244 | return 0; |
238 | } | 245 | } |
@@ -291,7 +298,7 @@ static void pstore_timefunc(unsigned long dummy) | |||
291 | schedule_work(&pstore_work); | 298 | schedule_work(&pstore_work); |
292 | } | 299 | } |
293 | 300 | ||
294 | mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL); | 301 | mod_timer(&pstore_timer, jiffies + msecs_to_jiffies(pstore_update_ms)); |
295 | } | 302 | } |
296 | 303 | ||
297 | module_param(backend, charp, 0444); | 304 | module_param(backend, charp, 0444); |