diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-10-04 19:12:13 +0900 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-10-28 01:30:01 +0200 |
commit | f81e3d4564a06c5a070337ba527d11865acecb67 (patch) | |
tree | 43fb5d4872c64b10421e588ab909c7d9ffcdb7e5 | |
parent | c5639bef63a241d8d5a00e5243d7f304d7563c46 (diff) | |
download | op-kernel-dev-f81e3d4564a06c5a070337ba527d11865acecb67.zip op-kernel-dev-f81e3d4564a06c5a070337ba527d11865acecb67.tar.gz |
jbd: Use printk_ratelimited() in journal_alloc_journal_head()
Use printk_ratelimited() instead of doing it manually.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/jbd/journal.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 2c4b1f1..d7a8693 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c @@ -36,6 +36,7 @@ #include <linux/poison.h> #include <linux/proc_fs.h> #include <linux/debugfs.h> +#include <linux/ratelimit.h> #include <asm/uaccess.h> #include <asm/page.h> @@ -1719,7 +1720,6 @@ static void journal_destroy_journal_head_cache(void) static struct journal_head *journal_alloc_journal_head(void) { struct journal_head *ret; - static unsigned long last_warning; #ifdef CONFIG_JBD_DEBUG atomic_inc(&nr_journal_heads); @@ -1727,11 +1727,9 @@ static struct journal_head *journal_alloc_journal_head(void) ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); if (ret == NULL) { jbd_debug(1, "out of memory for journal_head\n"); - if (time_after(jiffies, last_warning + 5*HZ)) { - printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", - __func__); - last_warning = jiffies; - } + printk_ratelimited(KERN_NOTICE "ENOMEM in %s, retrying.\n", + __func__); + while (ret == NULL) { yield(); ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); |