diff options
author | Paul Mackerras <paulus@samba.org> | 2008-04-14 07:11:02 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-14 07:11:02 -0400 |
commit | ac7c5353b189e10cf5dd27399f64f7b013abffc6 (patch) | |
tree | 8222d92b774c256d6ec4399c716d76b3f05ddc4b /fs/jbd2/journal.c | |
parent | a8f75ea70c58546205fb7673be41455b9da5d9a7 (diff) | |
parent | 120dd64cacd4fb796bca0acba3665553f1d9ecaa (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 12 |
1 files changed, 6 insertions, 6 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 | } |