Commit b9c3dc07 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] JBD: remove remaining sleep_on()s

Remove the remaining sleep_on() calls from JBD.
parent ba8edd6d
...@@ -85,11 +85,18 @@ void journal_commit_transaction(journal_t *journal) ...@@ -85,11 +85,18 @@ void journal_commit_transaction(journal_t *journal)
spin_lock(&commit_transaction->t_handle_lock); spin_lock(&commit_transaction->t_handle_lock);
while (commit_transaction->t_updates != 0) { while (commit_transaction->t_updates != 0) {
spin_unlock(&commit_transaction->t_handle_lock); DEFINE_WAIT(wait);
unlock_journal(journal);
sleep_on(&journal->j_wait_updates); prepare_to_wait(&journal->j_wait_updates, &wait,
lock_journal(journal); TASK_UNINTERRUPTIBLE);
spin_lock(&commit_transaction->t_handle_lock); if (commit_transaction->t_updates) {
spin_unlock(&commit_transaction->t_handle_lock);
unlock_journal(journal);
schedule();
lock_journal(journal);
spin_lock(&commit_transaction->t_handle_lock);
}
finish_wait(&journal->j_wait_updates, &wait);
} }
spin_unlock(&commit_transaction->t_handle_lock); spin_unlock(&commit_transaction->t_handle_lock);
......
...@@ -247,10 +247,8 @@ int kjournald(void *arg) ...@@ -247,10 +247,8 @@ int kjournald(void *arg)
static void journal_start_thread(journal_t *journal) static void journal_start_thread(journal_t *journal)
{ {
kernel_thread(kjournald, (void *) journal, kernel_thread(kjournald, journal, CLONE_VM|CLONE_FS|CLONE_FILES);
CLONE_VM | CLONE_FS | CLONE_FILES); wait_event(journal->j_wait_done_commit, journal->j_task != 0);
while (!journal->j_task)
sleep_on(&journal->j_wait_done_commit);
} }
static void journal_kill_thread(journal_t *journal) static void journal_kill_thread(journal_t *journal)
...@@ -259,7 +257,7 @@ static void journal_kill_thread(journal_t *journal) ...@@ -259,7 +257,7 @@ static void journal_kill_thread(journal_t *journal)
while (journal->j_task) { while (journal->j_task) {
wake_up(&journal->j_wait_commit); wake_up(&journal->j_wait_commit);
sleep_on(&journal->j_wait_done_commit); wait_event(journal->j_wait_done_commit, journal->j_task == 0);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment