aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd/journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd/journal.c')
-rw-r--r--fs/jbd/journal.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 65c290470664..5d9fec0b7ebd 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -217,7 +217,7 @@ static int journal_start_thread(journal_t *journal)
217 if (IS_ERR(t)) 217 if (IS_ERR(t))
218 return PTR_ERR(t); 218 return PTR_ERR(t);
219 219
220 wait_event(journal->j_wait_done_commit, journal->j_task != 0); 220 wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
221 return 0; 221 return 0;
222} 222}
223 223
@@ -229,7 +229,8 @@ static void journal_kill_thread(journal_t *journal)
229 while (journal->j_task) { 229 while (journal->j_task) {
230 wake_up(&journal->j_wait_commit); 230 wake_up(&journal->j_wait_commit);
231 spin_unlock(&journal->j_state_lock); 231 spin_unlock(&journal->j_state_lock);
232 wait_event(journal->j_wait_done_commit, journal->j_task == 0); 232 wait_event(journal->j_wait_done_commit,
233 journal->j_task == NULL);
233 spin_lock(&journal->j_state_lock); 234 spin_lock(&journal->j_state_lock);
234 } 235 }
235 spin_unlock(&journal->j_state_lock); 236 spin_unlock(&journal->j_state_lock);
@@ -1651,14 +1652,14 @@ static struct journal_head *journal_alloc_journal_head(void)
1651 atomic_inc(&nr_journal_heads); 1652 atomic_inc(&nr_journal_heads);
1652#endif 1653#endif
1653 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1654 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
1654 if (ret == 0) { 1655 if (ret == NULL) {
1655 jbd_debug(1, "out of memory for journal_head\n"); 1656 jbd_debug(1, "out of memory for journal_head\n");
1656 if (time_after(jiffies, last_warning + 5*HZ)) { 1657 if (time_after(jiffies, last_warning + 5*HZ)) {
1657 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", 1658 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
1658 __FUNCTION__); 1659 __FUNCTION__);
1659 last_warning = jiffies; 1660 last_warning = jiffies;
1660 } 1661 }
1661 while (ret == 0) { 1662 while (ret == NULL) {
1662 yield(); 1663 yield();
1663 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); 1664 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
1664 } 1665 }