From fb702a62415a9d5d835996ba5cf2e0aa58cb92a5 Mon Sep 17 00:00:00 2001 From: Pavel Emelianov Date: Tue, 8 May 2007 00:30:42 -0700 Subject: [PATCH] --- yaml --- r: 54703 b: refs/heads/master c: 97f067846786d255888ccad14e2f38a1f63d8e9b h: refs/heads/master i: 54701: 33c63cb164fe04780429de3c758cedc5242687f1 54699: 9ca6d4fe993f86129360cdc7502c213f6b7d3928 54695: 717c610dc9cac716b713de0aa0b7d29a6c92efbd 54687: 596182687b21b47362ed29d620ae7df55d5d1f27 v: v3 --- [refs] | 2 +- trunk/fs/jbd/journal.c | 13 +++++++++---- trunk/fs/jbd2/journal.c | 13 +++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 0043f707ce8d..6db892224f68 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee6f958291e2a768fd727e7a67badfff0b67711a +refs/heads/master: 97f067846786d255888ccad14e2f38a1f63d8e9b diff --git a/trunk/fs/jbd/journal.c b/trunk/fs/jbd/journal.c index e1eb7e999ae8..46fe7439fb91 100644 --- a/trunk/fs/jbd/journal.c +++ b/trunk/fs/jbd/journal.c @@ -210,10 +210,16 @@ static int kjournald(void *arg) return 0; } -static void journal_start_thread(journal_t *journal) +static int journal_start_thread(journal_t *journal) { - kthread_run(kjournald, journal, "kjournald"); + struct task_struct *t; + + t = kthread_run(kjournald, journal, "kjournald"); + if (IS_ERR(t)) + return PTR_ERR(t); + wait_event(journal->j_wait_done_commit, journal->j_task != 0); + return 0; } static void journal_kill_thread(journal_t *journal) @@ -839,8 +845,7 @@ static int journal_reset(journal_t *journal) /* Add the dynamic fields and write it to disk. */ journal_update_superblock(journal, 1); - journal_start_thread(journal); - return 0; + return journal_start_thread(journal); } /** diff --git a/trunk/fs/jbd2/journal.c b/trunk/fs/jbd2/journal.c index 6b3158ec9e2c..78d63b818f0b 100644 --- a/trunk/fs/jbd2/journal.c +++ b/trunk/fs/jbd2/journal.c @@ -210,10 +210,16 @@ static int kjournald2(void *arg) return 0; } -static void jbd2_journal_start_thread(journal_t *journal) +static int jbd2_journal_start_thread(journal_t *journal) { - kthread_run(kjournald2, journal, "kjournald2"); + struct task_struct *t; + + t = kthread_run(kjournald2, journal, "kjournald2"); + if (IS_ERR(t)) + return PTR_ERR(t); + wait_event(journal->j_wait_done_commit, journal->j_task != 0); + return 0; } static void journal_kill_thread(journal_t *journal) @@ -839,8 +845,7 @@ static int journal_reset(journal_t *journal) /* Add the dynamic fields and write it to disk. */ jbd2_journal_update_superblock(journal, 1); - jbd2_journal_start_thread(journal); - return 0; + return jbd2_journal_start_thread(journal); } /**