aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jbd/transaction.c')
-rw-r--r--fs/jbd/transaction.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index ca917973c2c0..c609f5034fcd 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -53,8 +53,8 @@ get_transaction(journal_t *journal, transaction_t *transaction)
53 spin_lock_init(&transaction->t_handle_lock); 53 spin_lock_init(&transaction->t_handle_lock);
54 54
55 /* Set up the commit timer for the new transaction. */ 55 /* Set up the commit timer for the new transaction. */
56 journal->j_commit_timer->expires = transaction->t_expires; 56 journal->j_commit_timer.expires = transaction->t_expires;
57 add_timer(journal->j_commit_timer); 57 add_timer(&journal->j_commit_timer);
58 58
59 J_ASSERT(journal->j_running_transaction == NULL); 59 J_ASSERT(journal->j_running_transaction == NULL);
60 journal->j_running_transaction = transaction; 60 journal->j_running_transaction = transaction;
@@ -455,7 +455,7 @@ void journal_lock_updates(journal_t *journal)
455 * to make sure that we serialise special journal-locked operations 455 * to make sure that we serialise special journal-locked operations
456 * too. 456 * too.
457 */ 457 */
458 down(&journal->j_barrier); 458 mutex_lock(&journal->j_barrier);
459} 459}
460 460
461/** 461/**
@@ -470,7 +470,7 @@ void journal_unlock_updates (journal_t *journal)
470{ 470{
471 J_ASSERT(journal->j_barrier_count != 0); 471 J_ASSERT(journal->j_barrier_count != 0);
472 472
473 up(&journal->j_barrier); 473 mutex_unlock(&journal->j_barrier);
474 spin_lock(&journal->j_state_lock); 474 spin_lock(&journal->j_state_lock);
475 --journal->j_barrier_count; 475 --journal->j_barrier_count;
476 spin_unlock(&journal->j_state_lock); 476 spin_unlock(&journal->j_state_lock);
@@ -1873,16 +1873,15 @@ zap_buffer_unlocked:
1873} 1873}
1874 1874
1875/** 1875/**
1876 * int journal_invalidatepage() 1876 * void journal_invalidatepage()
1877 * @journal: journal to use for flush... 1877 * @journal: journal to use for flush...
1878 * @page: page to flush 1878 * @page: page to flush
1879 * @offset: length of page to invalidate. 1879 * @offset: length of page to invalidate.
1880 * 1880 *
1881 * Reap page buffers containing data after offset in page. 1881 * Reap page buffers containing data after offset in page.
1882 * 1882 *
1883 * Return non-zero if the page's buffers were successfully reaped.
1884 */ 1883 */
1885int journal_invalidatepage(journal_t *journal, 1884void journal_invalidatepage(journal_t *journal,
1886 struct page *page, 1885 struct page *page,
1887 unsigned long offset) 1886 unsigned long offset)
1888{ 1887{
@@ -1893,7 +1892,7 @@ int journal_invalidatepage(journal_t *journal,
1893 if (!PageLocked(page)) 1892 if (!PageLocked(page))
1894 BUG(); 1893 BUG();
1895 if (!page_has_buffers(page)) 1894 if (!page_has_buffers(page))
1896 return 1; 1895 return;
1897 1896
1898 /* We will potentially be playing with lists other than just the 1897 /* We will potentially be playing with lists other than just the
1899 * data lists (especially for journaled data mode), so be 1898 * data lists (especially for journaled data mode), so be
@@ -1916,11 +1915,9 @@ int journal_invalidatepage(journal_t *journal,
1916 } while (bh != head); 1915 } while (bh != head);
1917 1916
1918 if (!offset) { 1917 if (!offset) {
1919 if (!may_free || !try_to_free_buffers(page)) 1918 if (may_free && try_to_free_buffers(page))
1920 return 0; 1919 J_ASSERT(!page_has_buffers(page));
1921 J_ASSERT(!page_has_buffers(page));
1922 } 1920 }
1923 return 1;
1924} 1921}
1925 1922
1926/* 1923/*