spin_lock_init(&transaction->t_handle_lock);
/* Set up the commit timer for the new transaction. */
- journal->j_commit_timer.expires = transaction->t_expires;
- add_timer(&journal->j_commit_timer);
+ journal->j_commit_timer->expires = transaction->t_expires;
+ add_timer(journal->j_commit_timer);
J_ASSERT(journal->j_running_transaction == NULL);
journal->j_running_transaction = transaction;
* to make sure that we serialise special journal-locked operations
* too.
*/
- mutex_lock(&journal->j_barrier);
+ down(&journal->j_barrier);
}
/**
{
J_ASSERT(journal->j_barrier_count != 0);
- mutex_unlock(&journal->j_barrier);
+ up(&journal->j_barrier);
spin_lock(&journal->j_state_lock);
--journal->j_barrier_count;
spin_unlock(&journal->j_state_lock);
}
/**
- * void journal_invalidatepage()
+ * int journal_invalidatepage()
* @journal: journal to use for flush...
* @page: page to flush
* @offset: length of page to invalidate.
*
* Reap page buffers containing data after offset in page.
*
+ * Return non-zero if the page's buffers were successfully reaped.
*/
-void journal_invalidatepage(journal_t *journal,
+int journal_invalidatepage(journal_t *journal,
struct page *page,
unsigned long offset)
{
if (!PageLocked(page))
BUG();
if (!page_has_buffers(page))
- return;
+ return 1;
/* We will potentially be playing with lists other than just the
* data lists (especially for journaled data mode), so be
} while (bh != head);
if (!offset) {
- if (may_free && try_to_free_buffers(page))
- J_ASSERT(!page_has_buffers(page));
+ if (!may_free || !try_to_free_buffers(page))
+ return 0;
+ J_ASSERT(!page_has_buffers(page));
}
+ return 1;
}
/*