aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-03-30 22:35:56 -0500
committerSteve French <sfrench@us.ibm.com>2006-03-30 22:35:56 -0500
commitd62e54abca1146981fc9f98f85ff398a113a22c2 (patch)
tree870420dbc4c65e716dcef8a802aafdc0ef97a8b4 /fs/jbd
parentfd4a0b92db6a57cba8d03efbe1cebf91f9124ce0 (diff)
parentce362c009250340358a7221f3cdb7954cbf19c01 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/checkpoint.c4
-rw-r--r--fs/jbd/journal.c31
-rw-r--r--fs/jbd/transaction.c21
3 files changed, 26 insertions, 30 deletions
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index 543ed543d1e5..3f5102b069db 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -85,7 +85,7 @@ void __log_wait_for_space(journal_t *journal)
85 if (journal->j_flags & JFS_ABORT) 85 if (journal->j_flags & JFS_ABORT)
86 return; 86 return;
87 spin_unlock(&journal->j_state_lock); 87 spin_unlock(&journal->j_state_lock);
88 down(&journal->j_checkpoint_sem); 88 mutex_lock(&journal->j_checkpoint_mutex);
89 89
90 /* 90 /*
91 * Test again, another process may have checkpointed while we 91 * Test again, another process may have checkpointed while we
@@ -98,7 +98,7 @@ void __log_wait_for_space(journal_t *journal)
98 log_do_checkpoint(journal); 98 log_do_checkpoint(journal);
99 spin_lock(&journal->j_state_lock); 99 spin_lock(&journal->j_state_lock);
100 } 100 }
101 up(&journal->j_checkpoint_sem); 101 mutex_unlock(&journal->j_checkpoint_mutex);
102 } 102 }
103} 103}
104 104
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index e4b516ac4989..7f96b5cb6781 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -33,9 +33,11 @@
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/suspend.h> 34#include <linux/suspend.h>
35#include <linux/pagemap.h> 35#include <linux/pagemap.h>
36#include <linux/kthread.h>
37#include <linux/proc_fs.h>
38
36#include <asm/uaccess.h> 39#include <asm/uaccess.h>
37#include <asm/page.h> 40#include <asm/page.h>
38#include <linux/proc_fs.h>
39 41
40EXPORT_SYMBOL(journal_start); 42EXPORT_SYMBOL(journal_start);
41EXPORT_SYMBOL(journal_restart); 43EXPORT_SYMBOL(journal_restart);
@@ -111,18 +113,15 @@ static void commit_timeout(unsigned long __data)
111 113
112static int kjournald(void *arg) 114static int kjournald(void *arg)
113{ 115{
114 journal_t *journal = (journal_t *) arg; 116 journal_t *journal = arg;
115 transaction_t *transaction; 117 transaction_t *transaction;
116 struct timer_list timer;
117 118
118 daemonize("kjournald"); 119 /*
119 120 * Set up an interval timer which can be used to trigger a commit wakeup
120 /* Set up an interval timer which can be used to trigger a 121 * after the commit interval expires
121 commit wakeup after the commit interval expires */ 122 */
122 init_timer(&timer); 123 setup_timer(&journal->j_commit_timer, commit_timeout,
123 timer.data = (unsigned long) current; 124 (unsigned long)current);
124 timer.function = commit_timeout;
125 journal->j_commit_timer = &timer;
126 125
127 /* Record that the journal thread is running */ 126 /* Record that the journal thread is running */
128 journal->j_task = current; 127 journal->j_task = current;
@@ -146,7 +145,7 @@ loop:
146 if (journal->j_commit_sequence != journal->j_commit_request) { 145 if (journal->j_commit_sequence != journal->j_commit_request) {
147 jbd_debug(1, "OK, requests differ\n"); 146 jbd_debug(1, "OK, requests differ\n");
148 spin_unlock(&journal->j_state_lock); 147 spin_unlock(&journal->j_state_lock);
149 del_timer_sync(journal->j_commit_timer); 148 del_timer_sync(&journal->j_commit_timer);
150 journal_commit_transaction(journal); 149 journal_commit_transaction(journal);
151 spin_lock(&journal->j_state_lock); 150 spin_lock(&journal->j_state_lock);
152 goto loop; 151 goto loop;
@@ -203,7 +202,7 @@ loop:
203 202
204end_loop: 203end_loop:
205 spin_unlock(&journal->j_state_lock); 204 spin_unlock(&journal->j_state_lock);
206 del_timer_sync(journal->j_commit_timer); 205 del_timer_sync(&journal->j_commit_timer);
207 journal->j_task = NULL; 206 journal->j_task = NULL;
208 wake_up(&journal->j_wait_done_commit); 207 wake_up(&journal->j_wait_done_commit);
209 jbd_debug(1, "Journal thread exiting.\n"); 208 jbd_debug(1, "Journal thread exiting.\n");
@@ -212,7 +211,7 @@ end_loop:
212 211
213static void journal_start_thread(journal_t *journal) 212static void journal_start_thread(journal_t *journal)
214{ 213{
215 kernel_thread(kjournald, journal, CLONE_VM|CLONE_FS|CLONE_FILES); 214 kthread_run(kjournald, journal, "kjournald");
216 wait_event(journal->j_wait_done_commit, journal->j_task != 0); 215 wait_event(journal->j_wait_done_commit, journal->j_task != 0);
217} 216}
218 217
@@ -659,8 +658,8 @@ static journal_t * journal_init_common (void)
659 init_waitqueue_head(&journal->j_wait_checkpoint); 658 init_waitqueue_head(&journal->j_wait_checkpoint);
660 init_waitqueue_head(&journal->j_wait_commit); 659 init_waitqueue_head(&journal->j_wait_commit);
661 init_waitqueue_head(&journal->j_wait_updates); 660 init_waitqueue_head(&journal->j_wait_updates);
662 init_MUTEX(&journal->j_barrier); 661 mutex_init(&journal->j_barrier);
663 init_MUTEX(&journal->j_checkpoint_sem); 662 mutex_init(&journal->j_checkpoint_mutex);
664 spin_lock_init(&journal->j_revoke_lock); 663 spin_lock_init(&journal->j_revoke_lock);
665 spin_lock_init(&journal->j_list_lock); 664 spin_lock_init(&journal->j_list_lock);
666 spin_lock_init(&journal->j_state_lock); 665 spin_lock_init(&journal->j_state_lock);
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/*