summaryrefslogtreecommitdiff
path: root/fs/jbd/journal.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-03-25 14:06:53 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 19:22:50 +0300
commite3df18983ea090a2e00dd5c2c6167bb431a0e0a2 (patch)
tree99f7944da7c8c85eed6738c1ef9f357f7dcae928 /fs/jbd/journal.c
parent1d9b7d97d6661edb44ce08f17e47c66d4ac20e34 (diff)
downloadlinux-e3df18983ea090a2e00dd5c2c6167bb431a0e0a2.tar.xz
[PATCH] jbd: embed j_commit_timer in journal struct
The kjournald timer is currently on the kernel thread's stack and the journal structure points at it. Save a pointer hop by moving the timer into the journal structure. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd/journal.c')
-rw-r--r--fs/jbd/journal.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index 95a628d8cac8..6bd4647dc5a1 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -111,18 +111,17 @@ static void commit_timeout(unsigned long __data)
static int kjournald(void *arg)
{
- journal_t *journal = (journal_t *) arg;
+ journal_t *journal = arg;
transaction_t *transaction;
- struct timer_list timer;
daemonize("kjournald");
- /* Set up an interval timer which can be used to trigger a
- commit wakeup after the commit interval expires */
- init_timer(&timer);
- timer.data = (unsigned long) current;
- timer.function = commit_timeout;
- journal->j_commit_timer = &timer;
+ /*
+ * Set up an interval timer which can be used to trigger a commit wakeup
+ * after the commit interval expires
+ */
+ setup_timer(&journal->j_commit_timer, commit_timeout,
+ (unsigned long)current);
/* Record that the journal thread is running */
journal->j_task = current;
@@ -146,7 +145,7 @@ loop:
if (journal->j_commit_sequence != journal->j_commit_request) {
jbd_debug(1, "OK, requests differ\n");
spin_unlock(&journal->j_state_lock);
- del_timer_sync(journal->j_commit_timer);
+ del_timer_sync(&journal->j_commit_timer);
journal_commit_transaction(journal);
spin_lock(&journal->j_state_lock);
goto loop;
@@ -203,7 +202,7 @@ loop:
end_loop:
spin_unlock(&journal->j_state_lock);
- del_timer_sync(journal->j_commit_timer);
+ del_timer_sync(&journal->j_commit_timer);
journal->j_task = NULL;
wake_up(&journal->j_wait_done_commit);
jbd_debug(1, "Journal thread exiting.\n");