From 6e1b8d42ad59ba29ed891d7bfa1e95281587ad37 Mon Sep 17 00:00:00 2001
From: Andrew Morton <akpm@digeo.com>
Date: Tue, 17 Jun 2003 18:32:40 -0700
Subject: [PATCH] [PATCH] JBD: remove j_commit_timer_active

This was a flag which said "the transaction's time is active".
timer_pending() could have told us that, but in fact there is no need to
query it at all.
---
 fs/jbd/journal.c     | 11 ++---------
 fs/jbd/transaction.c |  2 --
 include/linux/jbd.h  |  2 --
 3 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index bc371d019bd2..fb252f696360 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -157,11 +157,8 @@ int kjournald(void *arg)
 
 	if (journal->j_commit_sequence != journal->j_commit_request) {
 		jbd_debug(1, "OK, requests differ\n");
-		if (journal->j_commit_timer_active) {
-			journal->j_commit_timer_active = 0;
-			del_timer(journal->j_commit_timer);
-		}
 		spin_unlock(&journal->j_state_lock);
+		del_timer_sync(journal->j_commit_timer);
 		journal_commit_transaction(journal);
 		spin_lock(&journal->j_state_lock);
 		goto loop;
@@ -217,12 +214,8 @@ int kjournald(void *arg)
 	if (!(journal->j_flags & JFS_UNMOUNT))
 		goto loop;
 
-	if (journal->j_commit_timer_active) {
-		journal->j_commit_timer_active = 0;
-		del_timer_sync(journal->j_commit_timer);
-	}
 	spin_unlock(&journal->j_state_lock);
-
+	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");
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index eafe8c3464fb..8cccdc75bf2f 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -55,8 +55,6 @@ get_transaction(journal_t *journal, transaction_t *transaction)
 	spin_lock_init(&transaction->t_jcb_lock);
 
 	/* Set up the commit timer for the new transaction. */
-	J_ASSERT(!journal->j_commit_timer_active);
-	journal->j_commit_timer_active = 1;
 	journal->j_commit_timer->expires = transaction->t_expires;
 	add_timer(journal->j_commit_timer);
 	
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 645e69eef43c..12c0d2372dc7 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -626,7 +626,6 @@ struct transaction_s
  * @j_commit_interval: What is the maximum transaction lifetime before we begin
  *  a commit?
  * @j_commit_timer:  The timer used to wakeup the commit thread
- * @j_commit_timer_active: Timer flag
  * @j_revoke: The revoke table - maintains the list of revoked blocks in the
  *     current transaction.
  */
@@ -802,7 +801,6 @@ struct journal_s
 
 	/* The timer used to wakeup the commit thread: */
 	struct timer_list	*j_commit_timer;
-	int			j_commit_timer_active;	/* [j_state_lock] */
 
 	/*
 	 * The revoke table: maintains the list of revoked blocks in the
-- 
2.30.9