aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-04 06:12:13 -0400
committerJan Kara <jack@suse.cz>2010-10-27 19:30:01 -0400
commitf81e3d4564a06c5a070337ba527d11865acecb67 (patch)
tree43fb5d4872c64b10421e588ab909c7d9ffcdb7e5 /fs/jbd
parentc5639bef63a241d8d5a00e5243d7f304d7563c46 (diff)
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>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/journal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 2c4b1f109da9..d7a86935553a 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -36,6 +36,7 @@
36#include <linux/poison.h> 36#include <linux/poison.h>
37#include <linux/proc_fs.h> 37#include <linux/proc_fs.h>
38#include <linux/debugfs.h> 38#include <linux/debugfs.h>
39#include <linux/ratelimit.h>
39 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/page.h> 42#include <asm/page.h>
@@ -1719,7 +1720,6 @@ static void journal_destroy_journal_head_cache(void)
1719static struct journal_head *journal_alloc_journal_head(void) 1720static struct journal_head *journal_alloc_journal_head(void)
1720{ 1721{
1721 struct journal_head *ret; 1722 struct journal_head *ret;
1722 static unsigned long last_warning;
1723 1723
1724#ifdef CONFIG_JBD_DEBUG 1724#ifdef CONFIG_JBD_DEBUG
1725 atomic_inc(&nr_journal_heads); 1725 atomic_inc(&nr_journal_heads);
@@ -1727,11 +1727,9 @@ static struct journal_head *journal_alloc_journal_head(void)
1727 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1727 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
1728 if (ret == NULL) { 1728 if (ret == NULL) {
1729 jbd_debug(1, "out of memory for journal_head\n"); 1729 jbd_debug(1, "out of memory for journal_head\n");
1730 if (time_after(jiffies, last_warning + 5*HZ)) { 1730 printk_ratelimited(KERN_NOTICE "ENOMEM in %s, retrying.\n",
1731 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", 1731 __func__);
1732 __func__); 1732
1733 last_warning = jiffies;
1734 }
1735 while (ret == NULL) { 1733 while (ret == NULL) {
1736 yield(); 1734 yield();
1737 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1735 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);