diff options
Diffstat (limited to 'fs/jbd2')
-rw-r--r-- | fs/jbd2/journal.c | 12 | ||||
-rw-r--r-- | fs/jbd2/revoke.c | 4 |
2 files changed, 8 insertions, 8 deletions
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; |