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,12 +85,19 @@ void journal_commit_transaction(journal_t *journal)
spin_lock(&commit_transaction->t_handle_lock);
while (commit_transaction->t_updates != 0) {
DEFINE_WAIT(wait);
prepare_to_wait(&journal->j_wait_updates, &wait,
TASK_UNINTERRUPTIBLE);
if (commit_transaction->t_updates) {
spin_unlock(&commit_transaction->t_handle_lock);
unlock_journal(journal);
sleep_on(&journal->j_wait_updates);
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);
J_ASSERT (commit_transaction->t_outstanding_credits <=
......
......@@ -247,10 +247,8 @@ int kjournald(void *arg)
static void journal_start_thread(journal_t *journal)
{
kernel_thread(kjournald, (void *) journal,
CLONE_VM | CLONE_FS | CLONE_FILES);
while (!journal->j_task)
sleep_on(&journal->j_wait_done_commit);
kernel_thread(kjournald, journal, CLONE_VM|CLONE_FS|CLONE_FILES);
wait_event(journal->j_wait_done_commit, journal->j_task != 0);
}
static void journal_kill_thread(journal_t *journal)
......@@ -259,7 +257,7 @@ static void journal_kill_thread(journal_t *journal)
while (journal->j_task) {
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