提交 f81e3d45 编写于 作者: N Namhyung Kim 提交者: Jan Kara

jbd: Use printk_ratelimited() in journal_alloc_journal_head()

Use printk_ratelimited() instead of doing it manually.
Signed-off-by: NNamhyung Kim <namhyung@gmail.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 c5639bef
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/poison.h> #include <linux/poison.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/ratelimit.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/page.h> #include <asm/page.h>
...@@ -1719,7 +1720,6 @@ static void journal_destroy_journal_head_cache(void) ...@@ -1719,7 +1720,6 @@ static void journal_destroy_journal_head_cache(void)
static struct journal_head *journal_alloc_journal_head(void) static struct journal_head *journal_alloc_journal_head(void)
{ {
struct journal_head *ret; struct journal_head *ret;
static unsigned long last_warning;
#ifdef CONFIG_JBD_DEBUG #ifdef CONFIG_JBD_DEBUG
atomic_inc(&nr_journal_heads); atomic_inc(&nr_journal_heads);
...@@ -1727,11 +1727,9 @@ static struct journal_head *journal_alloc_journal_head(void) ...@@ -1727,11 +1727,9 @@ static struct journal_head *journal_alloc_journal_head(void)
ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
if (ret == NULL) { if (ret == NULL) {
jbd_debug(1, "out of memory for journal_head\n"); jbd_debug(1, "out of memory for journal_head\n");
if (time_after(jiffies, last_warning + 5*HZ)) { printk_ratelimited(KERN_NOTICE "ENOMEM in %s, retrying.\n",
printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", __func__);
__func__);
last_warning = jiffies;
}
while (ret == NULL) { while (ret == NULL) {
yield(); yield();
ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册