aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jbd/journal.c4
-rw-r--r--fs/jbd/revoke.c4
-rw-r--r--fs/jbd2/journal.c12
-rw-r--r--fs/jbd2/revoke.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 9816293442ab..0e081d5f32e8 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -1620,14 +1620,14 @@ static int journal_init_journal_head_cache(void)
1620{ 1620{
1621 int retval; 1621 int retval;
1622 1622
1623 J_ASSERT(journal_head_cache == 0); 1623 J_ASSERT(journal_head_cache == NULL);
1624 journal_head_cache = kmem_cache_create("journal_head", 1624 journal_head_cache = kmem_cache_create("journal_head",
1625 sizeof(struct journal_head), 1625 sizeof(struct journal_head),
1626 0, /* offset */ 1626 0, /* offset */
1627 SLAB_TEMPORARY, /* flags */ 1627 SLAB_TEMPORARY, /* flags */
1628 NULL); /* ctor */ 1628 NULL); /* ctor */
1629 retval = 0; 1629 retval = 0;
1630 if (journal_head_cache == 0) { 1630 if (!journal_head_cache) {
1631 retval = -ENOMEM; 1631 retval = -ENOMEM;
1632 printk(KERN_EMERG "JBD: no memory for journal_head cache\n"); 1632 printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
1633 } 1633 }
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index ad2eacf570c6..d5f8eee7c88c 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -173,13 +173,13 @@ int __init journal_init_revoke_caches(void)
173 0, 173 0,
174 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, 174 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
175 NULL); 175 NULL);
176 if (revoke_record_cache == 0) 176 if (!revoke_record_cache)
177 return -ENOMEM; 177 return -ENOMEM;
178 178
179 revoke_table_cache = kmem_cache_create("revoke_table", 179 revoke_table_cache = kmem_cache_create("revoke_table",
180 sizeof(struct jbd_revoke_table_s), 180 sizeof(struct jbd_revoke_table_s),
181 0, SLAB_TEMPORARY, NULL); 181 0, SLAB_TEMPORARY, NULL);
182 if (revoke_table_cache == 0) { 182 if (!revoke_table_cache) {
183 kmem_cache_destroy(revoke_record_cache); 183 kmem_cache_destroy(revoke_record_cache);
184 revoke_record_cache = NULL; 184 revoke_record_cache = NULL;
185 return -ENOMEM; 185 return -ENOMEM;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 96ba846992e9..954cff001df6 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -219,7 +219,7 @@ static int jbd2_journal_start_thread(journal_t *journal)
219 if (IS_ERR(t)) 219 if (IS_ERR(t))
220 return PTR_ERR(t); 220 return PTR_ERR(t);
221 221
222 wait_event(journal->j_wait_done_commit, journal->j_task != 0); 222 wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
223 return 0; 223 return 0;
224} 224}
225 225
@@ -231,7 +231,7 @@ static void journal_kill_thread(journal_t *journal)
231 while (journal->j_task) { 231 while (journal->j_task) {
232 wake_up(&journal->j_wait_commit); 232 wake_up(&journal->j_wait_commit);
233 spin_unlock(&journal->j_state_lock); 233 spin_unlock(&journal->j_state_lock);
234 wait_event(journal->j_wait_done_commit, journal->j_task == 0); 234 wait_event(journal->j_wait_done_commit, journal->j_task == NULL);
235 spin_lock(&journal->j_state_lock); 235 spin_lock(&journal->j_state_lock);
236 } 236 }
237 spin_unlock(&journal->j_state_lock); 237 spin_unlock(&journal->j_state_lock);
@@ -1969,14 +1969,14 @@ static int journal_init_jbd2_journal_head_cache(void)
1969{ 1969{
1970 int retval; 1970 int retval;
1971 1971
1972 J_ASSERT(jbd2_journal_head_cache == 0); 1972 J_ASSERT(jbd2_journal_head_cache == NULL);
1973 jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head", 1973 jbd2_journal_head_cache = kmem_cache_create("jbd2_journal_head",
1974 sizeof(struct journal_head), 1974 sizeof(struct journal_head),
1975 0, /* offset */ 1975 0, /* offset */
1976 SLAB_TEMPORARY, /* flags */ 1976 SLAB_TEMPORARY, /* flags */
1977 NULL); /* ctor */ 1977 NULL); /* ctor */
1978 retval = 0; 1978 retval = 0;
1979 if (jbd2_journal_head_cache == 0) { 1979 if (!jbd2_journal_head_cache) {
1980 retval = -ENOMEM; 1980 retval = -ENOMEM;
1981 printk(KERN_EMERG "JBD: no memory for journal_head cache\n"); 1981 printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
1982 } 1982 }
@@ -2002,14 +2002,14 @@ static struct journal_head *journal_alloc_journal_head(void)
2002 atomic_inc(&nr_journal_heads); 2002 atomic_inc(&nr_journal_heads);
2003#endif 2003#endif
2004 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS); 2004 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
2005 if (ret == 0) { 2005 if (!ret) {
2006 jbd_debug(1, "out of memory for journal_head\n"); 2006 jbd_debug(1, "out of memory for journal_head\n");
2007 if (time_after(jiffies, last_warning + 5*HZ)) { 2007 if (time_after(jiffies, last_warning + 5*HZ)) {
2008 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", 2008 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
2009 __FUNCTION__); 2009 __FUNCTION__);
2010 last_warning = jiffies; 2010 last_warning = jiffies;
2011 } 2011 }
2012 while (ret == 0) { 2012 while (!ret) {
2013 yield(); 2013 yield();
2014 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS); 2014 ret = kmem_cache_alloc(jbd2_journal_head_cache, GFP_NOFS);
2015 } 2015 }
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index df36f42e19e1..2e1453a5e998 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -174,13 +174,13 @@ int __init jbd2_journal_init_revoke_caches(void)
174 0, 174 0,
175 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY, 175 SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
176 NULL); 176 NULL);
177 if (jbd2_revoke_record_cache == 0) 177 if (!jbd2_revoke_record_cache)
178 return -ENOMEM; 178 return -ENOMEM;
179 179
180 jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table", 180 jbd2_revoke_table_cache = kmem_cache_create("jbd2_revoke_table",
181 sizeof(struct jbd2_revoke_table_s), 181 sizeof(struct jbd2_revoke_table_s),
182 0, SLAB_TEMPORARY, NULL); 182 0, SLAB_TEMPORARY, NULL);
183 if (jbd2_revoke_table_cache == 0) { 183 if (!jbd2_revoke_table_cache) {
184 kmem_cache_destroy(jbd2_revoke_record_cache); 184 kmem_cache_destroy(jbd2_revoke_record_cache);
185 jbd2_revoke_record_cache = NULL; 185 jbd2_revoke_record_cache = NULL;
186 return -ENOMEM; 186 return -ENOMEM;